Add tests for underline and strike though. More const.

This commit is contained in:
treeform 2021-09-06 09:20:16 -07:00
parent fd3c9f64e7
commit 301c6bd31c
9 changed files with 22 additions and 3 deletions

View file

@ -889,7 +889,7 @@ const cffStandardStrings = [
"Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000",
"001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"]
let TOP_DICT_META = {
const TOP_DICT_META = {
0: "version",
1: "notice",
1200: "copyright",
@ -922,7 +922,7 @@ let TOP_DICT_META = {
1238: "fontName",
}.toTable
let PRIVATE_DICT_META = {
const PRIVATE_DICT_META = {
19: "subrs",
20: "defaultWidthX",
21: "nominalWidthX",

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -1004,7 +1004,6 @@ block:
doDiff(image, "cff")
block:
var font = readFont("tests/fonts/NotoSansJP-Regular.ttf")
font.size = 26
@ -1013,3 +1012,23 @@ block:
image.fillText(font, "仰コソ会票カク帰了ノ終準港みせス議徳モチタ提請ルまつ力路お")
doDiff(image, "cff_jp")
block:
var font = readFont("tests/fonts/Inter-Regular.ttf")
font.size = 26
font.underline = true
let image = newImage(800, 100)
image.fill(rgba(255, 255, 255, 255))
image.fillText(font, "Grumpy wizards make toxic brew for the evil Queen and Jack.")
doDiff(image, "cff_underline")
block:
var font = readFont("tests/fonts/Inter-Regular.ttf")
font.size = 26
font.strikethrough = true
let image = newImage(800, 100)
image.fill(rgba(255, 255, 255, 255))
image.fillText(font, "Grumpy wizards make toxic brew for the evil Queen and Jack.")
doDiff(image, "cff_strikethrough")