Mercurial > projects > dynamin
annotate text.d @ 96:301e077da540
Add the beginnings of a Windows Uniscribe text backend.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Wed, 02 May 2012 03:19:00 -0500 |
parents | |
children | 5c8c1c2e12c0 |
rev | line source |
---|---|
96
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
1 // testing with word العربية al-arabiyyah |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
2 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
3 /* |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
4 I may need to keep some info around (especially advance widths) so I can pass it to ScriptCPtoX(), ScriptXtoCP(), and other functions. |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
5 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
6 First, call ScriptItemize(). It will return *items* that have one script and direction. |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
7 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
8 My code will have a list of ranges where the formatting is the same. I need to split the items from ScriptItemize() into *runs* that have the same format, script, and direction. The run is an array of WCHARs (should be a slice). |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
9 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
10 Then, I call ScriptShape once for each of these runs, and it returns an array of the glyphs, among other things. |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
11 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
12 Now that I have the glyphs, I can pass them to ScriptPlace(), which returns an array of the advance widths for each of them. (By default they are in visual order, but you can request them in logical order.) I can edit these to apply the letter spacing. Kerning would also take place here, I believe. I think I would edit tab widths here too. |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
13 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
14 If the text needs justified, I can call ScriptJustify() with the advance widths (and other data) for the entire line. It will return updated advance widths. |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
15 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
16 I can call ScriptBreak() for each item from ScriptItemize(), passing it the info for the item. It will return an array with: |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
17 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
18 - Places in the item where it can be broken across lines |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
19 - Places in the item that the caret can move when left or right is pressed |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
20 - Places in the item the caret can move when Ctrl+Left/Right is pressed (words) |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
21 */ |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
22 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
23 import tango.io.Stdout; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
24 import dynamin.c.windows; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
25 import dynamin.core.string; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
26 import dynamin.painting.text_layout; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
27 import dynamin.all; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
28 extern(Windows): |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
29 int callback(ENUMLOGFONTEX* elf, TEXTMETRIC*, DWORD, LPARAM) { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
30 int i = 0; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
31 for(; i < LF_FULLFACESIZE; i++) |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
32 if(elf.elfFullName[i] == 0) |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
33 break; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
34 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
35 int j = 0; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
36 for(; j < LF_FACESIZE; j++) |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
37 if(elf.elfStyle[j] == 0) |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
38 break; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
39 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
40 Stdout(elf.elfFullName[0..i])(" ... ")(elf.elfStyle[0..j]).newline; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
41 return 1; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
42 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
43 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
44 void main() { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
45 //string text = "The first text to draw."; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
46 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
47 // a reasonable size of a paragraph |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
48 //scope buf = new wchar[text.length < 256 ? 256 : 1536]; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
49 //wchar[] wtext = text.toString16(buf); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
50 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
51 LOGFONT lf; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
52 lf.lfCharSet = 1; // DEFAULT_CHARSET |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
53 lf.lfFaceName[0] = '\0'; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
54 //EnumFontFamiliesEx(GetDC(null), &lf, &callback, 0, 0); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
55 Window w = new Window; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
56 w.text = "TextLayout test"; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
57 auto t = new TextLayout("Garamond", 20); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
58 //t.text = "John said, 'I bought 24 eggs.' How many did you buy?"; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
59 t.text = "Whenyouhaveareallylongword you approach -look, colors!- Fort Sutch, you will encounter a group of Imperial Guards, including an Imperial Guard Captain, who will request your assistance in defeating the Daedra pouring out of the nearby Oblivion Gate. The final Daedra you will need to defeat will be a leveled Dremora, who will emerge through the Gate as you approach it. When all the Daedra are defeated, return to the Captain. Speak with him, he will tell you to close the gate if you wish, but informs you that he will be staying at Fort Sutch per his orders."; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
60 //t.setForeColor(Color.Blue, 26, 5); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
61 t.setBold(true, 5, 4); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
62 t.setItalic(true, 2, 7); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
63 t.setFontFamily("Tahoma", 31, 3); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
64 t.setFontSize(35, 35, 4); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
65 t.setForeColor(Color.Blue, 40, 7); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
66 t.setForeColor(Color.Red, 47, 8); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
67 t.setBackColor(Color.Gold, 47, 8); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
68 w.content.painting += (PaintingEventArgs args) { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
69 try { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
70 t.draw(args.graphics); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
71 } catch(Exception e) { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
72 Stdout("Exception: (")(e.line)(") ")(e.msg).newline; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
73 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
74 }; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
75 w.content.resized += { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
76 auto sz = w.content.size; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
77 t.layoutBoxes = [Rect(0, 0, sz.width/2, sz.height/2), Rect(sz.width/2, sz.height/2, sz.width/2, sz.height/2)]; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
78 }; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
79 w.size = [640, 480]; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
80 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
81 w.visible = true; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
82 Application.run(w); |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
83 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
84 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
85 /* |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
86 // Build thorough tests into showcase |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
87 class TextParagraph { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
88 // support kerning? GetKerningPairs() and KERNINGPAIR |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
89 void layout(char[] text, ) { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
90 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
91 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
92 char[] text; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
93 Tab[] tabs; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
94 uint defaultTabLocations = 0; // no default tabs |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
95 // newLineSpacing = old * mul + delta |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
96 // spacing after line, as part of it |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
97 real lineSpacingMul = 1.0; // percent |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
98 real lineSpacingDelta = 0; // pixels |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
99 Alignment alignment; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
100 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
101 uint width; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
102 delegate wrap |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
103 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
104 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
105 // Word uses SOH as placeholder for embedded obj |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
106 // Word uses VT for a soft return |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
107 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
108 struct Tab { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
109 int location; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
110 TabType type; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
111 TabLeading leading; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
112 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
113 struct EmbeddedObject { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
114 Point location; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
115 Size size; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
116 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
117 Format { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
118 string family; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
119 real size; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
120 bool bold; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
121 bool italic; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
122 // spaces are not underlined, overlined, or strikethrough unless |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
123 // words on both sides are |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
124 LineStyle underlined; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
125 LineStyle strikethrough; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
126 LineStyle overlined; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
127 bool superscript; // 2/3 of the height |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
128 bool subscript; // 2/3 of the height |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
129 real letterSpacingMul = 1.0; // after letter, as part of it |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
130 real letterSpacingAdd = 0; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
131 // ( ^ useful for Hexplore's column spacing) |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
132 Color foreColor; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
133 Color backColor; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
134 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
135 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
136 offsetof |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
137 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
138 // underline, strikethrough, and overline line styles |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
139 enum LineStyle { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
140 None, |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
141 Single, |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
142 Double, |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
143 Dotted, |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
144 Dashed, |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
145 Wavy |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
146 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
147 FormatChange { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
148 FormatType type; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
149 void apply(ref Format format) { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
150 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
151 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
152 union Data { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
153 string family; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
154 real size; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
155 bool on; // bold and italic |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
156 LineStyle lineStyle; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
157 real letterSpacing; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
158 Color color; |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
159 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
160 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
161 enum FormatType : ubyte { |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
162 Family, Size, Bold, Italic, Underline, Strikethrough, Overline, |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
163 |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
164 } |
301e077da540
Add the beginnings of a Windows Uniscribe text backend.
Jordan Miner <jminer7@gmail.com>
parents:
diff
changeset
|
165 */ |