1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Aldaron's Format Interface / Aldaron's Document Format (docf)
// Copyright (c) 2017 Plop Grizzly, Jeron Lau <jeron.lau@plopgrizzly.com>
// Licensed under the MIT LICENSE
//
// src/lib.rs

//! Aldaron's Format Interface / docf is a library developed by Plop Grizzly for
//! reading and writing docf (Aldaron's Document Format) files.

#![no_std]
#![warn(missing_docs)]
#![doc(html_logo_url = "http://plopgrizzly.com/afi_docf/icon.png",
	html_favicon_url = "http://plopgrizzly.com/afi_docf/icon.png",
	html_root_url = "http://plopgrizzly.com/afi_docf/")]

/// Text alignment
#[repr(u8)] #[derive(PartialEq, Copy, Clone)]
pub enum Align {
	/// Left aligned
	Left = 0u8,
	/// Horizontally centered
	Centered = 1u8,
	/// Right aligned
	Right = 2u8,
	/// Justified
	Justified = 3u8,
}

/// Text emphasis
#[repr(u8)] #[derive(PartialEq, Copy, Clone)]
pub enum Emphasis {
	/// Regular
	None = 0b_0000_0000_u8,
	/// Strikethrough
	StrikeOut = 0b_0000_0001_u8,
	/// Overline
	Overline = 0b_0000_0010_u8,
	/// Underline Continuous
	Underline = 0b_0000_0100_u8,
	/// Underline Discontinuous
	UnderlineDC = 0b_0000_1000_u8,
	/// Double Underline
	UnderlineX2 = 0b_0001_0000_u8,
	/// Invert Colors
	InvertColor = 0b_0010_0000_u8,
	/// Bold
	Bold = 0b_0100_0000_u8,
	/// Italic
	Italic = 0b_1000_0000_u8,
}

/// Text color
#[repr(u8)] #[derive(PartialEq, Copy, Clone)]
pub enum FontColor {
	/// Black on light background, or white on dark background
	Default,
	/// RGBA 32 bits
	RgbaInt(u8, u8, u8, u8),
	/// RGBA Floating Point
	RgbaFloat(f32, f32, f32, f32),
}