Check-in [402db317f0]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Made produced seven segment font pass all the tests of the Microsoft Font Verifier. The font, however, is still not acceptable to Windows either for Preview or Install.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:402db317f0d0625e60d87f7744128cd306e758b2
User & Date: Ross 2015-12-22 08:24:22
Context
2015-12-23
02:39
Found cause of installation problem on Windows due to missing a string from the TTF name table. Along the way, improved the calculation of a number of head and hhea fields, and made a variety of other tweaks. The output is now a valid (if badly named) TTF file that covers 0-9, A-F and a few punctuation marks drawn with inter-digit dots. check-in: 3a564d3a11 user: Ross tags: trunk
2015-12-22
08:24
Made produced seven segment font pass all the tests of the Microsoft Font Verifier. The font, however, is still not acceptable to Windows either for Preview or Install. check-in: 402db317f0 user: Ross tags: trunk
2015-12-18
01:24
Improved comments. check-in: a262d54ce0 user: Ross tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/dotfonter.lua.

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
62
63
64
65
66
67
68
69
70
..
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106




107
108
109
110
111
112
113
114
115
116
117
118



119
120
121
122
123
124

125
126
127
128
129
130
131
132
133
134
These are ready to be added to a glyph if called out in the rom.
The style here is very angular, and does not include any gaps
between segments that would have to appear in practical display
construction.
]]
local segments = {
    a=X{[0]='contour',
        {[0]='pt', x=0,   y=896, on=1},
        {[0]='pt', x=640, y=896, on=1},
        {[0]='pt', x=512, y=768, on=1},
        {[0]='pt', x=128, y=768, on=1},
    },
    b=X{[0]='contour',
        {[0]='pt', x=640, y=896, on=1},
        {[0]='pt', x=640, y=448, on=1},
        {[0]='pt', x=512, y=512, on=1},
        {[0]='pt', x=512, y=768, on=1},
    },
    c=X{[0]='contour',
        {[0]='pt', x=640, y=448, on=1},
        {[0]='pt', x=640, y=0,   on=1},
        {[0]='pt', x=512, y=128, on=1},
        {[0]='pt', x=512, y=384, on=1},
    },
    d=X{[0]='contour',
        {[0]='pt', x=640, y=0, on=1},
        {[0]='pt', x=0,   y=0, on=1},
        {[0]='pt', x=128, y=128, on=1},
        {[0]='pt', x=512, y=128, on=1},
    },
    e=X{[0]='contour',
        {[0]='pt', x=0,   y=0,   on=1},
        {[0]='pt', x=0,   y=448, on=1},
        {[0]='pt', x=128, y=384, on=1},
        {[0]='pt', x=128, y=128, on=1},
    },
    f=X{[0]='contour',
        {[0]='pt', x=0,   y=448, on=1},
        {[0]='pt', x=0,   y=896, on=1},
        {[0]='pt', x=128, y=768, on=1},
        {[0]='pt', x=128, y=512, on=1},
    },
    g=X{[0]='contour',
        {[0]='pt', x=0,   y=448, on=1},
        {[0]='pt', x=128, y=512, on=1},
        {[0]='pt', x=512, y=512, on=1},
        {[0]='pt', x=640, y=448, on=1},
        {[0]='pt', x=512, y=384, on=1},
        {[0]='pt', x=128, y=384, on=1},
    },
}

--[[ 
##seven segment character generator ROM for HEX digits

The segments are arranged as follows
................................................................................

Because Lua likes strings, we use a simpler coding here where each 
character maps to a string contain a list of lit segments. From that
list, characters not in [a-g] will simply be ignored.

--]]
local rom = {
    ['0'] = 'abcdef ', --0x3f,
    ['1'] = ' bc    ', --0x06,
    ['2'] = 'ab de g', --0x5b,
    ['3'] = 'abcd  g', --0x4f,
    ['4'] = ' bc  fg', --0x66,
    ['5'] = 'a cd fg', --0x6d,
    ['6'] = 'a cdefg', --0x7d,
    ['7'] = 'abc    ', --0x07,
    ['8'] = 'abcdefg', --0x7f,
    ['9'] = 'abc  fg', --0x67,
    ['A'] = 'abc efg', --0x77,
    ['B'] = '  cdefg', --0x7c,
    ['C'] = 'a  def ', --0x39,
    ['D'] = ' bcde g', --0x5e,
    ['E'] = 'a  defg', --0x79,
    ['F'] = 'a   efg', --0x71,
}

-- Run through the caracters in the rom and assemble a glyph for each
-- one and map in in the font.
for char,pat in pairs(rom) do




    local g = X{[0]="TTGlyph", name=char,}
    for seg in ('abcdefg'):gmatch'.' do
        if rom[char]:find(seg) then
            g[#g+1] = segments[seg]
        end
    end
    g[#g+1] = X{[0]='instructions',X{[0]='assembly'}}
    -- when placing the glyph, we also must include the metrics.
    -- For seven segments, the only character with non-zero lsb
    -- will be the digit '1' so we check for that and adjust.
    ttfont.PlaceGlyph(g, {width=1024, lsb= char=='1' and 512 or 0})
    ttfont.MapGlyph("unicode", char:byte(), char)



    ttfont.MapGlyph("win", char:byte(), char)
end

--[[ Adjust the strings.
--]]
ttfont.SetNames{

    copy='Copyright Lloyd Fingal 2015.',
    ffam='Upright Seven Segments',
    PSnm='UprightSevenSegments-Regular',
    demo='ABCDEF 0123456789',
}

-- get the finished font and write it as TTX
local font = ttfont.GetFont()
--print(font)
font:save("temp.ttx")







|
|
|
|


|
|
|
|


|
|
|
|


|
|
|
|


|
|
|
|


|
|
|
|


|
|
|
|
|
|







 







|
|
|
|
|
|
|
|
|
|











>
>
>
>
|

|








|
>
>
>
|





>










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
62
63
64
65
66
67
68
69
70
..
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
These are ready to be added to a glyph if called out in the rom.
The style here is very angular, and does not include any gaps
between segments that would have to appear in practical display
construction.
]]
local segments = {
    a=X{[0]='contour',
        {[0]='pt', x=2,   y=896, on=1},
        {[0]='pt', x=638, y=896, on=1},
        {[0]='pt', x=510, y=768, on=1},
        {[0]='pt', x=130, y=768, on=1},
    },
    b=X{[0]='contour',
        {[0]='pt', x=640, y=894, on=1},
        {[0]='pt', x=640, y=450, on=1},
        {[0]='pt', x=512, y=514, on=1},
        {[0]='pt', x=512, y=766, on=1},
    },
    c=X{[0]='contour',
        {[0]='pt', x=640, y=446, on=1},
        {[0]='pt', x=640, y=2,   on=1},
        {[0]='pt', x=512, y=130, on=1},
        {[0]='pt', x=512, y=382, on=1},
    },
    d=X{[0]='contour',
        {[0]='pt', x=639, y=0, on=1},
        {[0]='pt', x=1,   y=0, on=1},
        {[0]='pt', x=129, y=128, on=1},
        {[0]='pt', x=511, y=128, on=1},
    },
    e=X{[0]='contour',
        {[0]='pt', x=0,   y=2,   on=1},
        {[0]='pt', x=0,   y=446, on=1},
        {[0]='pt', x=128, y=382, on=1},
        {[0]='pt', x=128, y=130, on=1},
    },
    f=X{[0]='contour',
        {[0]='pt', x=0,   y=450, on=1},
        {[0]='pt', x=0,   y=894, on=1},
        {[0]='pt', x=128, y=766, on=1},
        {[0]='pt', x=128, y=514, on=1},
    },
    g=X{[0]='contour',
        {[0]='pt', x=1,   y=448, on=1},
        {[0]='pt', x=129, y=512, on=1},
        {[0]='pt', x=511, y=512, on=1},
        {[0]='pt', x=639, y=448, on=1},
        {[0]='pt', x=511, y=384, on=1},
        {[0]='pt', x=129, y=384, on=1},
    },
}

--[[ 
##seven segment character generator ROM for HEX digits

The segments are arranged as follows
................................................................................

Because Lua likes strings, we use a simpler coding here where each 
character maps to a string contain a list of lit segments. From that
list, characters not in [a-g] will simply be ignored.

--]]
local rom = {
    ['0'] = {'abcdef ', n='zero'}, --0x3f,
    ['1'] = {' bc    ', n='one'},--0x06,
    ['2'] = {'ab de g', n='two'},--0x5b,
    ['3'] = {'abcd  g', n='three'},--0x4f,
    ['4'] = {' bc  fg', n='four'},--0x66,
    ['5'] = {'a cd fg', n='five'},--0x6d,
    ['6'] = {'a cdefg', n='six'}, --0x7d,
    ['7'] = {'abc    ', n='seven'}, --0x07,
    ['8'] = {'abcdefg', n='eight'}, --0x7f,
    ['9'] = {'abc  fg', n='nine'}, --0x67,
    ['A'] = 'abc efg', --0x77,
    ['B'] = '  cdefg', --0x7c,
    ['C'] = 'a  def ', --0x39,
    ['D'] = ' bcde g', --0x5e,
    ['E'] = 'a  defg', --0x79,
    ['F'] = 'a   efg', --0x71,
}

-- Run through the caracters in the rom and assemble a glyph for each
-- one and map in in the font.
for char,pat in pairs(rom) do
    local name = char
    if type(pat) == 'table' then
        pat,name = rom[char][1], rom[char].n
    end
    local g = X{[0]="TTGlyph", name=name,}
    for seg in ('abcdefg'):gmatch'.' do
        if pat:find(seg) then
            g[#g+1] = segments[seg]
        end
    end
    g[#g+1] = X{[0]='instructions',X{[0]='assembly'}}
    -- when placing the glyph, we also must include the metrics.
    -- For seven segments, the only character with non-zero lsb
    -- will be the digit '1' so we check for that and adjust.
    ttfont.PlaceGlyph(g, {width=1024, lsb= char=='1' and 512 or 0})
    ttfont.MapGlyph("unicode", char:byte(), name)
    if char:byte() <= 0x7f then
        ttfont.MapGlyph("mac", char:byte(), name)
    end
    ttfont.MapGlyph("win", char:byte(), name)
end

--[[ Adjust the strings.
--]]
ttfont.SetNames{
    vers='Version 001.042',
    copy='Copyright Lloyd Fingal 2015.',
    ffam='Upright Seven Segments',
    PSnm='UprightSevenSegments-Regular',
    demo='ABCDEF 0123456789',
}

-- get the finished font and write it as TTX
local font = ttfont.GetFont()
--print(font)
font:save("temp.ttx")

Changes to src/ttfhead.lua.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

local M={ _NAME=(...) }
package.loaded[M._NAME] = M
local ttx = require 'ttxml'

M.tableVersion = '1.0'
M.fontRevision = '1.0'
M.checkSumAdjustment = 0
M.magicNumber="0x5f0f3cf5"
M.flags = '00000000 00000000'
M.unitsPerEm = 1024
M.xMin = 0
M.yMin = 0
M.xMax = 0
M.yMax = 0
M.macStyle = '00000000 00000000'
M.lowestRecPPEM = 8






|


|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

local M={ _NAME=(...) }
package.loaded[M._NAME] = M
local ttx = require 'ttxml'

M.tableVersion = '1.0'
M.fontRevision = '1.042'
M.checkSumAdjustment = 0
M.magicNumber="0x5f0f3cf5"
M.flags = '00000000 00001011'
M.unitsPerEm = 1024
M.xMin = 0
M.yMin = 0
M.xMax = 0
M.yMax = 0
M.macStyle = '00000000 00000000'
M.lowestRecPPEM = 8

Changes to src/ttfname.lua.

103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
    [17]='psub',--Preferred Subfamily (Windows only). 
    [18]='cnam',--Compatible Full (Mac OS only). 
    [19]='demo',--Sample text.
    [20]='PSff',--PostScript CID findfont name.
}
local defaults = {
    [2] = 'Regular',
    [5] = 'Version 1.000 default',
    [8] = 'Dotfonter',
    -- This pangram comes from http://www.fun-with-words.com/pang_visitor.html
    -- and contains tributes to two famous type designers and to the mathematician
    -- who described the parameterized curves used in TTF glyphs. It is also short
    -- enough at 38 characters.
    [19] =  'Mix Zapf with Veljovic and get quirky Beziers',
    [256] = 'Compiled by Dotfonter',







|







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
    [17]='psub',--Preferred Subfamily (Windows only). 
    [18]='cnam',--Compatible Full (Mac OS only). 
    [19]='demo',--Sample text.
    [20]='PSff',--PostScript CID findfont name.
}
local defaults = {
    [2] = 'Regular',
    [5] = 'Version 001.000',
    [8] = 'Dotfonter',
    -- This pangram comes from http://www.fun-with-words.com/pang_visitor.html
    -- and contains tributes to two famous type designers and to the mathematician
    -- who described the parameterized curves used in TTF glyphs. It is also short
    -- enough at 38 characters.
    [19] =  'Mix Zapf with Veljovic and get quirky Beziers',
    [256] = 'Compiled by Dotfonter',

Changes to src/ttfont.lua.

86
87
88
89
90
91
92

93
94
95
96
97
98
99
100
101
102
103
104

105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
...
129
130
131
132
133
134
135



136
137
138
139
140
141
142
143
144

145
146

147
148
149
150
151
152







153
154
155
156
157
158

159
160
161
162
163
164
165
166






167
168
169
170
171
172
173
174
175
176
177
178
...
201
202
203
204
205
206
207



208
209
210
211
212
213
214
215
216
217
218
219
    },
    {[0]='contour',
        {[0]='pt', x=192, y= 64, on=1},
        {[0]='pt', x=832, y= 64, on=1},
        {[0]='pt', x=832, y=704, on=1},
        {[0]='pt', x=192, y=704, on=1},
    },

    {[0]='contour',
        {[0]='pt', x=128, y= 45, on=1},
        {[0]='pt', x=851, y=768, on=1},
        {[0]='pt', x=896, y=723, on=1},
        {[0]='pt', x=183, y=  0, on=1},
    },
    {[0]='contour',
        {[0]='pt', x=128, y=723, on=1},
        {[0]='pt', x=183, y=768, on=1},
        {[0]='pt', x=896, y= 45, on=1},
        {[0]='pt', x=851, y=  0, on=1},
    },

    {[0]='instructions',{[0]='assembly'}},
}
-- an empty glyph.
local nullglyph = xml.new{[0]="TTGlyph", name=".null" }
local crglyph = xml.new{[0]="TTGlyph", name="CR" }
local spaceglyph = xml.new{[0]="TTGlyph", name="space" }

-- first four glyphs are recommended to be .notdef, .null, CR, and space
M.PlaceGlyph(notdefglyph, {width=1024, lsb=128})
M.PlaceGlyph(nullglyph, {width=0,lsb=0} )
M.PlaceGlyph(crglyph, {width=512,lsb=0}) 
M.PlaceGlyph(spaceglyph, {width=1024,lsb=0})


--[[
#CMAP table is whole can of worms

The four mandatory glyphs have some special roles, and are usually expected
................................................................................
recommended that the text in that table be in a platform, encoding, and language
that has a matching cmap table.


--]]
tables.cmap = xml.new{[0]='cmap',
    X{[0]='tableVersion', version='0'},



    X{[0]='cmap_format_0', platformID=1, platEncID=0, language=0,
        X{[0]='map', code='0x0', name='.null'},
    },
    X{[0]='cmap_format_4', platformID=3, platEncID=1, language='0x409',
        X{[0]='map', code='0x0', name='.null'},
        X{[0]='map', code='0xD', name='CR'},
        X{[0]='map', code='0x20', name='space'},
    }
}

local function setname(n,m,s)
    local map = tables.cmap[n]:find('map', 'code', ('0x%X'):format(tonumber(m)))

    if map then
        map.name = s
    else
        tables.cmap[n]:append{[0]='map', code=('0x%x'):format(tonumber(m)), name=s}
    end
end







for i=0x1,0xff do 
    tables.cmap[2]:append{[0]='map', code=('0x%x'):format(tonumber(i)), name='.notdef'}
end
setname(2, 0x08, '.null')
setname(2, 0x1D, '.null')
setname(2, 0x0D, 'CR')

setname(2, 0x09, 'space')
setname(2, 0x20, 'space')
setname(2, 0xA0, 'space')
for i=0x21,0xff do 
    tables.cmap[3]:append{[0]='map', code=('0x%x'):format(tonumber(i)), name='.notdef'}
end
setname(3, 0xA0, 'space')







function M.MapGlyph(map, code, name)
    local maps = {unicode=2, win=3}
    map = maps[map] or tonumber(map)
    if not map then error"map not valid" end
    if map >= 2 and map <= 3 then
        setname(map, code, name)
    end
end


tables.name = ttfname.BuildNameTable{
    copy='Copyright Lloyd Fingal 2015.',
................................................................................
    ttfhhea.descent = -128
    tables.hhea = ttfhhea.GetTable()
    tables.maxp = ttfmaxp.GetTable()
    tables.post = ttfpost.GetTable()
    tables.OS_2 = ttfos_2.GetTable()

    if not tables.loca then tables.loca = xml.new"loca" end



    local font = xml.new{[0]="ttFont", sfntVersion="\\x00\\x01\\x00\\x00", ttLibVersion="3.0"}
    for _,tn in ipairs{'GlyphOrder','head','hhea','maxp',
        'OS_2','hmtx','cmap','loca','glyf','name','post'} do
        if tables[tn] then 
            font:append(tables[tn])
        end
    end
    return font
end


return M







>











|
>




|





|







 







>
>
>



|
|
|
|


>


>






>
>
>
>
>
>
>

|

|
|
<
>
|
|
|
<
<
<
|

>
>
>
>
>
>

|


|







 







>
>
>


|









86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
...
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171

172
173
174
175



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
...
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
    },
    {[0]='contour',
        {[0]='pt', x=192, y= 64, on=1},
        {[0]='pt', x=832, y= 64, on=1},
        {[0]='pt', x=832, y=704, on=1},
        {[0]='pt', x=192, y=704, on=1},
    },
    --[[
    {[0]='contour',
        {[0]='pt', x=128, y= 45, on=1},
        {[0]='pt', x=851, y=768, on=1},
        {[0]='pt', x=896, y=723, on=1},
        {[0]='pt', x=183, y=  0, on=1},
    },
    {[0]='contour',
        {[0]='pt', x=128, y=723, on=1},
        {[0]='pt', x=183, y=768, on=1},
        {[0]='pt', x=896, y= 45, on=1},
        {[0]='pt', x=851, y=  0, on=1},
    }, 
    --]]
    {[0]='instructions',{[0]='assembly'}},
}
-- an empty glyph.
local nullglyph = xml.new{[0]="TTGlyph", name=".null" }
local crglyph = xml.new{[0]="TTGlyph", name="nonmarkingreturn" }
local spaceglyph = xml.new{[0]="TTGlyph", name="space" }

-- first four glyphs are recommended to be .notdef, .null, CR, and space
M.PlaceGlyph(notdefglyph, {width=1024, lsb=128})
M.PlaceGlyph(nullglyph, {width=0,lsb=0} )
M.PlaceGlyph(crglyph, {width=1024,lsb=0}) 
M.PlaceGlyph(spaceglyph, {width=1024,lsb=0})


--[[
#CMAP table is whole can of worms

The four mandatory glyphs have some special roles, and are usually expected
................................................................................
recommended that the text in that table be in a platform, encoding, and language
that has a matching cmap table.


--]]
tables.cmap = xml.new{[0]='cmap',
    X{[0]='tableVersion', version='0'},
    X{[0]='cmap_format_4', platformID=0, platEncID=3, language=0,
        --X{[0]='map', code='0x0', name='.null'},
    },
    X{[0]='cmap_format_0', platformID=1, platEncID=0, language=0,
        X{[0]='map', code='0x0', name='.null'},
    },
    X{[0]='cmap_format_4', platformID=3, platEncID=1, language=0, --language='0x409',
        --X{[0]='map', code='0x0', name='.null'},
        --X{[0]='map', code='0xD', name='nonmarkingreturn'},
        --X{[0]='map', code='0x20', name='space'},
    }
}

local function setname(n,m,s)
    local map = tables.cmap[n]:find('map', 'code', ('0x%X'):format(tonumber(m)))
        or tables.cmap[n]:find('map', 'code', ('0x%x'):format(tonumber(m)))
    if map then
        map.name = s
    else
        tables.cmap[n]:append{[0]='map', code=('0x%x'):format(tonumber(m)), name=s}
    end
end

-- Unicode Map
setname(2, 0x20, 'space')
setname(2, 0x20AC, 'space') -- Unicode Euro

-- Mac 8-bit Map
-- Fill out all codes 0..255  
for i=0x1,0xff do 
    tables.cmap[3]:append{[0]='map', code=('0x%x'):format(tonumber(i)), name='.notdef'}
end
setname(3, 0x08, '.null')
setname(3, 0x1D, '.null')

setname(3, 0x0D, 'nonmarkingreturn')
setname(3, 0x09, 'space')
setname(3, 0x20, 'space')
setname(3, 0xA0, 'space')



setname(3, 0xDB, 'space') -- Mac Euro


-- Windows Unicode Map
setname(4, 0x20, 'space')
--setname(4, 0xFF, 'space')
setname(4, 0x20AC, 'space') -- Unicode Euro

function M.MapGlyph(map, code, name)
    local maps = {unicode=2, mac=3, win=4}
    map = maps[map] or tonumber(map)
    if not map then error"map not valid" end
    if map >= 2 and map <= 4 then
        setname(map, code, name)
    end
end


tables.name = ttfname.BuildNameTable{
    copy='Copyright Lloyd Fingal 2015.',
................................................................................
    ttfhhea.descent = -128
    tables.hhea = ttfhhea.GetTable()
    tables.maxp = ttfmaxp.GetTable()
    tables.post = ttfpost.GetTable()
    tables.OS_2 = ttfos_2.GetTable()

    if not tables.loca then tables.loca = xml.new"loca" end
    if not tables.gasp then tables.gasp = xml.new"gasp" end
    tables.gasp:append(xml.new{[0]="gaspRange", rangeMaxPPEM=65535, rangeGaspBehavior=2})
    
    local font = xml.new{[0]="ttFont", sfntVersion="\\x00\\x01\\x00\\x00", ttLibVersion="3.0"}
    for _,tn in ipairs{'GlyphOrder','head','hhea','maxp',
        'OS_2','hmtx','cmap','loca','glyf','name','post', 'gasp'} do
        if tables[tn] then 
            font:append(tables[tn])
        end
    end
    return font
end


return M

Changes to src/ttfos_2.lua.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
..
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
package.loaded[M._NAME] = M
local ttx = require 'ttxml'

M.version = 3
M.xAvgCharWidth =1024
M.usWeightClass =400 -- Normal
M.usWidthClass =5 -- Normal
M.fsType ='00000000 00000000'
M.ySubscriptXSize =768
M.ySubscriptYSize =768
M.ySubscriptXOffset =0
M.ySubscriptYOffset =256
M.ySuperscriptXSize =768
M.ySuperscriptYSize =768
M.ySuperscriptXOffset =0
................................................................................
M.ulUnicodeRange1 ='00000000 00000000 00000000 00000001'
M.ulUnicodeRange2 ='00000000 00000000 00000000 00000000'
M.ulUnicodeRange3 ='00000000 00000000 00000000 00000000'
M.ulUnicodeRange4 ='00000000 00000000 00000000 00000000'
M.achVendID ='    '
M.fsSelection ='00000000 00000000'
M.usFirstCharIndex =0
M.usLastCharIndex =0
M.sTypoAscender =896
M.sTypoDescender =-128
M.sTypoLineGap =0
M.usWinAscent =896
M.usWinDescent =128
M.ulCodePageRange1 ='00000000 00000000 00000000 00000001'
M.ulCodePageRange2 ='00000000 00000000 00000000 00000000'
M.sxHeight =512
M.sCapHeight =896
M.usDefaultChar =0
M.usBreakChar =32
M.usMaxContext =1

M.panose = {
    bFamilyType = 0,
    bSerifStyle = 0,
    bWeight = 0,
    bProportion = 0,
    bContrast = 0,
    bStrokeVariation = 0,
    bArmStyle = 0,
    bLetterForm = 0,
    bMidline = 0,
    bXHeight = 0,
}







|







 







|











|


|

|
|







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
..
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
package.loaded[M._NAME] = M
local ttx = require 'ttxml'

M.version = 3
M.xAvgCharWidth =1024
M.usWeightClass =400 -- Normal
M.usWidthClass =5 -- Normal
M.fsType ='00000000 00001000'
M.ySubscriptXSize =768
M.ySubscriptYSize =768
M.ySubscriptXOffset =0
M.ySubscriptYOffset =256
M.ySuperscriptXSize =768
M.ySuperscriptYSize =768
M.ySuperscriptXOffset =0
................................................................................
M.ulUnicodeRange1 ='00000000 00000000 00000000 00000001'
M.ulUnicodeRange2 ='00000000 00000000 00000000 00000000'
M.ulUnicodeRange3 ='00000000 00000000 00000000 00000000'
M.ulUnicodeRange4 ='00000000 00000000 00000000 00000000'
M.achVendID ='    '
M.fsSelection ='00000000 00000000'
M.usFirstCharIndex =0
M.usLastCharIndex =0xa0
M.sTypoAscender =896
M.sTypoDescender =-128
M.sTypoLineGap =0
M.usWinAscent =896
M.usWinDescent =128
M.ulCodePageRange1 ='00000000 00000000 00000000 00000001'
M.ulCodePageRange2 ='00000000 00000000 00000000 00000000'
M.sxHeight =512
M.sCapHeight =896
M.usDefaultChar =0
M.usBreakChar =32
M.usMaxContext =0

M.panose = {
    bFamilyType = 2,
    bSerifStyle = 0,
    bWeight = 6,
    bProportion = 9,
    bContrast = 0,
    bStrokeVariation = 0,
    bArmStyle = 0,
    bLetterForm = 0,
    bMidline = 0,
    bXHeight = 0,
}

Changes to src/ttfpost.lua.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package.loaded[M._NAME] = M
local ttx = require 'ttxml'

M.formatType = '2.0'
M.italicAngle = '0.0'
M.underlinePosition = "-128"
M.underlineThickness = "32"
M.isFixedPitch = "0"
M.minMemType42 = "0"
M.maxMemType42 = "0"
M.minMemType1 = "0"
M.maxMemType1 = "0"
M.psNames = {}
M.extraNames = {fields={[0]='psName','name'}, '.notdef','.null','CR','space'}

function M.GetTable()
    return ttx.buildTable("post",{ 
            'formatType',
            'italicAngle',
            'underlinePosition',
            'underlineThickness',







|





|







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package.loaded[M._NAME] = M
local ttx = require 'ttxml'

M.formatType = '2.0'
M.italicAngle = '0.0'
M.underlinePosition = "-128"
M.underlineThickness = "32"
M.isFixedPitch = "1"
M.minMemType42 = "0"
M.maxMemType42 = "0"
M.minMemType1 = "0"
M.maxMemType1 = "0"
M.psNames = {}
M.extraNames = {fields={[0]='psName','name'},}-- '.notdef','.null','CR','space'}

function M.GetTable()
    return ttx.buildTable("post",{ 
            'formatType',
            'italicAngle',
            'underlinePosition',
            'underlineThickness',