more ttc
This commit is contained in:
parent
dffe86074f
commit
655099a64e
4 changed files with 54 additions and 51 deletions
|
@ -949,10 +949,19 @@ const cffStandardStrings = [
|
||||||
const TOP_DICT_META = {
|
const TOP_DICT_META = {
|
||||||
0: "version",
|
0: "version",
|
||||||
1: "notice",
|
1: "notice",
|
||||||
1200: "copyright",
|
|
||||||
2: "fullName",
|
2: "fullName",
|
||||||
3: "familyName",
|
3: "familyName",
|
||||||
4: "weight",
|
4: "weight",
|
||||||
|
5: "fontBBox",
|
||||||
|
|
||||||
|
13: "uniqueId",
|
||||||
|
14: "xuid",
|
||||||
|
15: "charset",
|
||||||
|
16: "encoding",
|
||||||
|
17: "charStrings",
|
||||||
|
18: "private",
|
||||||
|
|
||||||
|
1200: "copyright",
|
||||||
1201: "isFixedPitch",
|
1201: "isFixedPitch",
|
||||||
1202: "italicAngle",
|
1202: "italicAngle",
|
||||||
1203: "underlinePosition",
|
1203: "underlinePosition",
|
||||||
|
@ -960,14 +969,7 @@ const TOP_DICT_META = {
|
||||||
1205: "paintType",
|
1205: "paintType",
|
||||||
1206: "charstringType",
|
1206: "charstringType",
|
||||||
1207: "fontMatrix",
|
1207: "fontMatrix",
|
||||||
13: "uniqueId",
|
|
||||||
5: "fontBBox",
|
|
||||||
1208: "strokeWidth",
|
1208: "strokeWidth",
|
||||||
14: "xuid",
|
|
||||||
15: "charset",
|
|
||||||
16: "encoding",
|
|
||||||
17: "charStrings",
|
|
||||||
18: "private",
|
|
||||||
1230: "ros",
|
1230: "ros",
|
||||||
1231: "cidFontVersion",
|
1231: "cidFontVersion",
|
||||||
1232: "cidFontRevision",
|
1232: "cidFontRevision",
|
||||||
|
|
Binary file not shown.
BIN
tests/fonts/PTSans.ttc
Normal file
BIN
tests/fonts/PTSans.ttc
Normal file
Binary file not shown.
|
@ -1,18 +1,19 @@
|
||||||
import pixie, strformat, unicode, pixie/fontformats/opentype
|
import pixie, strformat, unicode, pixie/fontformats/opentype
|
||||||
|
|
||||||
block:
|
block:
|
||||||
var font = readFont("/Windows/Fonts/simsun.ttc")
|
var font = readFont("tests/fonts/PTSans.ttc")
|
||||||
font.size = 72
|
font.size = 72
|
||||||
let image = newImage(220, 100)
|
let image = newImage(200, 100)
|
||||||
image.fill(rgba(255, 255, 255, 255))
|
image.fill(rgba(255, 255, 255, 255))
|
||||||
image.fillText(font, "大目鳥")
|
image.fillText(font, "AbCd")
|
||||||
image.writeFile("ttc.png")
|
# image.writeFile("ttc.png")
|
||||||
|
|
||||||
block:
|
block:
|
||||||
var fonts = parseOpenTypeCollection(readFile("/Windows/Fonts/simsun.ttc"))
|
var fonts = parseOpenTypeCollection(readFile("tests/fonts/PTSans.ttc"))
|
||||||
for font in fonts:
|
for i, font in fonts:
|
||||||
echo font.fullName
|
echo i, ": ", font.fullName
|
||||||
|
|
||||||
|
when defined(windows):
|
||||||
block:
|
block:
|
||||||
let files = @[
|
let files = @[
|
||||||
"/Windows/Fonts/batang.ttc",
|
"/Windows/Fonts/batang.ttc",
|
||||||
|
|
Loading…
Reference in a new issue