afi_docf/
lib.rs

1// Aldaron's Format Interface / Aldaron's Document Format (docf)
2// Copyright (c) 2017 Plop Grizzly, Jeron Lau <jeron.lau@plopgrizzly.com>
3// Licensed under the MIT LICENSE
4//
5// src/lib.rs
6
7//! Aldaron's Format Interface / docf is a library developed by Plop Grizzly for
8//! reading and writing docf (Aldaron's Document Format) files.
9
10#![no_std]
11#![warn(missing_docs)]
12#![doc(html_logo_url = "http://plopgrizzly.com/afi_docf/icon.png",
13	html_favicon_url = "http://plopgrizzly.com/afi_docf/icon.png",
14	html_root_url = "http://plopgrizzly.com/afi_docf/")]
15
16/// Text alignment
17#[repr(u8)] #[derive(PartialEq, Copy, Clone)]
18pub enum Align {
19	/// Left aligned
20	Left = 0u8,
21	/// Horizontally centered
22	Centered = 1u8,
23	/// Right aligned
24	Right = 2u8,
25	/// Justified
26	Justified = 3u8,
27}
28
29/// Text emphasis
30#[repr(u8)] #[derive(PartialEq, Copy, Clone)]
31pub enum Emphasis {
32	/// Regular
33	None = 0b_0000_0000_u8,
34	/// Strikethrough
35	StrikeOut = 0b_0000_0001_u8,
36	/// Overline
37	Overline = 0b_0000_0010_u8,
38	/// Underline Continuous
39	Underline = 0b_0000_0100_u8,
40	/// Underline Discontinuous
41	UnderlineDC = 0b_0000_1000_u8,
42	/// Double Underline
43	UnderlineX2 = 0b_0001_0000_u8,
44	/// Invert Colors
45	InvertColor = 0b_0010_0000_u8,
46	/// Bold
47	Bold = 0b_0100_0000_u8,
48	/// Italic
49	Italic = 0b_1000_0000_u8,
50}
51
52/// Text color
53#[repr(u8)] #[derive(PartialEq, Copy, Clone)]
54pub enum FontColor {
55	/// Black on light background, or white on dark background
56	Default,
57	/// RGBA 32 bits
58	RgbaInt(u8, u8, u8, u8),
59	/// RGBA Floating Point
60	RgbaFloat(f32, f32, f32, f32),
61}