Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error: struct.error: 'H' format requires 0 <= number <= 65535 #453

Open
NightFurySL2001 opened this issue Jun 6, 2023 · 11 comments
Open

Comments

@NightFurySL2001
Copy link

NightFurySL2001 commented Jun 6, 2023

When running the following code, it reports 'H' format requires 0 <= number <= 65535.

test-strokesvg.csv
SVG files: test-strokesvg.zip

> nanoemoji --color_format glyf --glyphmap_file ..\test-strokesvg.csv (dir *.svg| %{ $_.Name })

I0606 18:20:25.762645 11396 nanoemoji.py:639] Proceeding with 1 config(s)
I0606 18:20:25.977644 11396 nanoemoji.py:602] Wrote build\Font.toml
I0606 18:20:25.977644 11396 nanoemoji.py:645] Generating build.ninja
I0606 18:20:26.509648 11396 ninja.py:124] ninja -C D:\Desktop\coding\svg2font\test\test-strokesvg\build
ninja: Entering directory `D:\Desktop\coding\svg2font\test\test-strokesvg\build'
[1/1] C:\Users\User\AppData\Local\Programs\Python\Python310\python.exe -m nanoemoji.write_fo...e Font.toml --fea_file Font.fea --glyphmap_file Font.glyphmap --part_file parts-merged.json
FAILED: Font.ttf
C:\Users\User\AppData\Local\Programs\Python\Python310\python.exe -m nanoemoji.write_font -v 0 --config_file Font.toml --fea_file Font.fea --glyphmap_file Font.glyphmap --part_file parts-merged.json
W0606 18:20:34.505856 15004 glyph_reuse.py:69] affine_between failed: M353.6904602050781,0.58203125 L422.6851806640625,190.21160888671875 C431.9973449707031,216.03173828125 390.93914794921875,227.03704833984375 382.0502624511719,201.64019775390625 L313.0555419921875,12.0106201171875 C303.7433776855469,-13.80950927734375 344.80157470703125,-24.8148193359375 353.6904602050781,0.58203125 L353.6904602050781,0.58203125 Z M692.3148193359375,512.7513427734375 L865.8597412109375,595.7142944335938 C890.4100341796875,607.566162109375 868.8226928710938,643.96826171875 844.6957397460938,632.1163940429688 L671.1507568359375,549.1534423828125 C646.6005249023438,537.3016357421875 668.1878051757812,500.8995056152344 692.3148193359375,512.7513427734375 L692.3148193359375,512.7513427734375 Z
W0606 18:20:37.877620 15004 glyph_reuse.py:69] affine_between failed: M524.2724609375,519.5238037109375 L654.2195434570312,541.111083984375 C681.3095092773438,545.7672119140625 669.4576416015625,586.402099609375 642.791015625,581.74609375 L512.8438720703125,560.1587524414062 C485.75396728515625,555.502685546875 497.6058044433594,514.8677368164062 524.2724609375,519.5238037109375 L524.2724609375,519.5238037109375 Z M876.8650512695312,539.41796875 L799.8280029296875,438.6772766113281 C783.3201293945312,417.0899658203125 820.1454467773438,395.92596435546875 836.2301635742188,417.51324462890625 L913.2672119140625,518.2540283203125 C929.7750854492188,539.84130859375 892.9496459960938,561.0053100585938 876.8650512695312,539.41796875 L876.8650512695312,539.41796875 Z
W0606 18:20:40.296896 15004 glyph_reuse.py:69] affine_between failed: M368.9285583496094,398.888916015625 L374.0079040527344,92.857177734375 C374.43121337890625,65.76727294921875 416.7592468261719,65.34393310546875 416.3359680175781,92.857177734375 L411.256591796875,398.888916015625 C410.83331298828125,425.97882080078125 368.5052795410156,426.40216064453125 368.9285583496094,398.888916015625 L368.9285583496094,398.888916015625 Z M506.0714111328125,375.6085205078125 L500.9920349121094,70 C500.5687561035156,42.48675537109375 542.8967895507812,42.91009521484375 543.320068359375,70 L548.3994140625,375.6085205078125 C548.82275390625,403.1217041015625 506.49468994140625,402.69842529296875 506.0714111328125,375.6085205078125 L506.0714111328125,375.6085205078125 Z
W0606 18:20:42.217883 15004 glyph_reuse.py:69] affine_between failed: M542.4735107421875,-24.8148193359375 L656.3359375,-10.42327880859375 C683.0026245117188,-7.03704833984375 683.4259033203125,35.291015625 656.3359375,31.90478515625 L542.4735107421875,17.51324462890625 C515.806884765625,14.12701416015625 515.383544921875,-28.2010498046875 542.4735107421875,-24.8148193359375 L542.4735107421875,-24.8148193359375 Z M619.933837890625,112.3280029296875 L734.2195434570312,126.71954345703125 C760.88623046875,130.1058349609375 761.3095092773438,172.433837890625 734.2195434570312,169.047607421875 L619.933837890625,154.65606689453125 C593.2672119140625,151.26983642578125 592.8438720703125,108.9417724609375 619.933837890625,112.3280029296875 L619.933837890625,112.3280029296875 Z
W0606 18:20:43.011886 15004 glyph_reuse.py:69] affine_between failed: M506.0714111328125,375.6085205078125 L500.9920349121094,70 C500.5687561035156,42.48675537109375 542.8967895507812,42.91009521484375 543.320068359375,70 L548.3994140625,375.6085205078125 C548.82275390625,403.1217041015625 506.49468994140625,402.69842529296875 506.0714111328125,375.6085205078125 L506.0714111328125,375.6085205078125 Z M382.4735107421875,547.0369873046875 L376.12432861328125,243.96826171875 C375.7010498046875,216.455078125 418.0290832519531,216.87835693359375 418.4523620605469,243.96826171875 L424.80157470703125,547.0369873046875 C425.224853515625,574.55029296875 382.8968200683594,574.126953125 382.4735107421875,547.0369873046875 L382.4735107421875,547.0369873046875 Z
W0606 18:20:43.934884 15004 glyph_reuse.py:69] affine_between failed: M771.46826171875,315.92596435546875 L765.1190185546875,-27.77777099609375 C764.6957397460938,-55.29095458984375 807.0238037109375,-54.86767578125 807.4470825195312,-27.77777099609375 L813.7962646484375,315.92596435546875 C814.2195434570312,343.43914794921875 771.8915405273438,343.015869140625 771.46826171875,315.92596435546875 L771.46826171875,315.92596435546875 Z M356.23016357421875,389.1534423828125 L369.7751159667969,29.3651123046875 C370.6216735839844,2.27520751953125 412.94970703125,1.85186767578125 412.1031799316406,29.3651123046875 L398.55816650390625,389.1534423828125 C397.7116394042969,416.243408203125 355.38360595703125,416.66668701171875 356.23016357421875,389.1534423828125 L356.23016357421875,389.1534423828125 Z
W0606 18:20:44.095889 15004 glyph_reuse.py:69] affine_between failed: M427.7645568847656,223.2275390625 L417.1825256347656,9.470947265625 C415.91265869140625,-17.6190185546875 458.24072265625,-17.6190185546875 459.5105895996094,9.470947265625 L470.09259033203125,223.2275390625 C471.3624267578125,250.31744384765625 429.0343933105469,250.31744384765625 427.7645568847656,223.2275390625 L427.7645568847656,223.2275390625 Z M707.9761962890625,263.439208984375 L699.0872802734375,58.148193359375 C697.8174438476562,31.05828857421875 740.1455078125,31.05828857421875 741.415283203125,58.148193359375 L750.30419921875,263.439208984375 C751.5740966796875,290.52911376953125 709.2460327148438,290.52911376953125 707.9761962890625,263.439208984375 L707.9761962890625,263.439208984375 Z
W0606 18:20:44.601891 15004 glyph_reuse.py:69] affine_between failed: M334.2195739746094,47.566162109375 L519.193115234375,117.40740966796875 C544.5899047851562,127.14288330078125 533.5846557617188,167.77783203125 507.7645263671875,158.04241943359375 L322.7909851074219,88.2010498046875 C297.3941650390625,78.46563720703125 308.39947509765625,37.83074951171875 334.2195739746094,47.566162109375 L334.2195739746094,47.566162109375 Z M681.7327880859375,577.5132446289062 L599.6163940429688,407.77777099609375 C587.7645263671875,383.2275390625 624.1666259765625,362.0634765625 636.0184936523438,386.61376953125 L718.1348876953125,556.3492431640625 C729.9867553710938,580.8994750976562 693.5846557617188,602.0634765625 681.7327880859375,577.5132446289062 L681.7327880859375,577.5132446289062 Z
W0606 18:20:44.816888 15004 glyph_reuse.py:69] affine_between failed: M662.6851806640625,192.32806396484375 L794.7486572265625,205.0264892578125 C821.838623046875,207.56610107421875 821.838623046875,249.8941650390625 794.7486572265625,247.3544921875 L662.6851806640625,234.6561279296875 C635.59521484375,232.116455078125 635.59521484375,189.78839111328125 662.6851806640625,192.32806396484375 L662.6851806640625,192.32806396484375 Z M611.46826171875,447.98944091796875 L556.0184936523438,332.857177734375 C544.1666259765625,308.306884765625 580.5687866210938,286.7196044921875 592.4205932617188,311.693115234375 L647.870361328125,426.825439453125 C659.72216796875,451.3757019042969 623.320068359375,472.96295166015625 611.46826171875,447.98944091796875 L611.46826171875,447.98944091796875 Z
W0606 18:20:45.644893 15004 glyph_reuse.py:69] affine_between failed: M443.8492126464844,453.4920959472656 L418.0290832519531,405.661376953125 C404.90740966796875,381.534423828125 441.7327880859375,360.370361328125 454.43121337890625,384.49737548828125 L480.2513122558594,432.32806396484375 C493.3730163574219,456.4550476074219 456.5475769042969,477.61907958984375 443.8492126464844,453.4920959472656 L443.8492126464844,453.4920959472656 Z M763.4259033203125,453.91534423828125 L810.4100341796875,428.5185546875 C834.5369873046875,415.3968505859375 855.7010498046875,452.22222900390625 831.5740356445312,464.920654296875 L784.5899047851562,490.3174743652344 C760.4629516601562,503.43914794921875 739.2988891601562,466.61376953125 763.4259033203125,453.91534423828125 L763.4259033203125,453.91534423828125 Z
W0606 18:20:46.713889 15004 glyph_reuse.py:69] affine_between failed: M681.7327880859375,577.5132446289062 L599.6163940429688,407.77777099609375 C587.7645263671875,383.2275390625 624.1666259765625,362.0634765625 636.0184936523438,386.61376953125 L718.1348876953125,556.3492431640625 C729.9867553710938,580.8994750976562 693.5846557617188,602.0634765625 681.7327880859375,577.5132446289062 L681.7327880859375,577.5132446289062 Z M391.78570556640625,17.9365234375 L572.94970703125,88.2010498046875 C597.9232788085938,97.93658447265625 587.3412475585938,138.9947509765625 561.5211791992188,128.83599853515625 L380.3571472167969,58.57147216796875 C355.38360595703125,48.8359375 365.9656066894531,7.77777099609375 391.78570556640625,17.9365234375 L391.78570556640625,17.9365234375 Z
W0606 18:20:47.558884 15004 glyph_reuse.py:69] affine_between failed: M412.1031799316406,185.13232421875 L845.5422973632812,207.98944091796875 C872.6322021484375,209.25927734375 872.6322021484375,251.58734130859375 845.5422973632812,250.31744384765625 L412.1031799316406,227.4603271484375 C385.0132141113281,226.19049072265625 385.0132141113281,183.8624267578125 412.1031799316406,185.13232421875 L412.1031799316406,185.13232421875 Z M396.0185241699219,584.708984375 L821.4153442382812,628.7301635742188 C848.0819702148438,631.693115234375 848.5052490234375,674.0211791992188 821.4153442382812,671.0582275390625 L396.0185241699219,627.0370483398438 C369.3518371582031,624.0740966796875 368.9285583496094,581.74609375 396.0185241699219,584.708984375 L396.0185241699219,584.708984375 Z
W0606 18:20:47.865890 15004 glyph_reuse.py:69] affine_between failed: M382.4735107421875,547.0369873046875 L376.12432861328125,243.96826171875 C375.7010498046875,216.455078125 418.0290832519531,216.87835693359375 418.4523620605469,243.96826171875 L424.80157470703125,547.0369873046875 C425.224853515625,574.55029296875 382.8968200683594,574.126953125 382.4735107421875,547.0369873046875 L382.4735107421875,547.0369873046875 Z M262.26190185546875,497.0899658203125 L274.11376953125,180.05291748046875 C274.9603271484375,152.9630126953125 317.2883605957031,152.5396728515625 316.4418029785156,180.05291748046875 L304.5899353027344,497.0899658203125 C303.7433776855469,524.179931640625 261.41534423828125,524.6031494140625 262.26190185546875,497.0899658203125 L262.26190185546875,497.0899658203125 Z
W0606 18:20:50.987977 15004 glyph_reuse.py:69] affine_between failed: M556.4417724609375,381.11114501953125 L895.0661010742188,474.6561279296875 C921.3094482421875,481.8518371582031 910.3042602539062,522.9100341796875 883.6375122070312,515.291015625 L545.01318359375,421.74609375 C518.7698364257812,414.55029296875 529.775146484375,373.4920654296875 556.4417724609375,381.11114501953125 L556.4417724609375,381.11114501953125 Z M350.3042297363281,464.4973449707031 L182.6851806640625,185.13232421875 C168.7169189453125,161.85186767578125 205.11904907226562,140.26458740234375 219.08729553222656,163.96826171875 L386.7063293457031,443.3333435058594 C400.6745910644531,466.61376953125 364.2724609375,488.2010803222656 350.3042297363281,464.4973449707031 L350.3042297363281,464.4973449707031 Z
W0606 18:20:52.620978 15004 glyph_reuse.py:69] affine_between failed: M683.0026245117188,431.90478515625 L825.224853515625,456.8783264160156 C851.8914794921875,461.5343933105469 840.462890625,502.5926208496094 813.7962646484375,497.51324462890625 L671.5740356445312,472.5397033691406 C644.9074096679688,467.88360595703125 656.3359375,426.825439453125 683.0026245117188,431.90478515625 L683.0026245117188,431.90478515625 Z M560.674560546875,356.1375732421875 L701.2036743164062,381.11114501953125 C727.8703002929688,385.7672119140625 716.4418334960938,426.825439453125 689.7750854492188,421.74609375 L549.2460327148438,396.77252197265625 C522.579345703125,392.11639404296875 534.0079345703125,351.0582275390625 560.674560546875,356.1375732421875 L560.674560546875,356.1375732421875 Z
W0606 18:20:53.525983 15004 glyph_reuse.py:69] affine_between failed: M722.791015625,319.31219482421875 L814.6428833007812,329.470947265625 C841.3095092773438,332.43389892578125 841.7327880859375,374.76190185546875 814.6428833007812,371.7989501953125 L722.791015625,361.6402587890625 C696.1243286132812,358.67724609375 695.7010498046875,316.3492431640625 722.791015625,319.31219482421875 L722.791015625,319.31219482421875 Z M565.75390625,139.84130859375 L528.5052490234375,56.03173828125 C517.5,31.48150634765625 553.902099609375,9.89422607421875 564.9074096679688,34.86773681640625 L602.1560668945312,118.67730712890625 C613.161376953125,143.2275390625 576.7592163085938,164.81488037109375 565.75390625,139.84130859375 L565.75390625,139.84130859375 Z
W0606 18:20:56.388992 15004 glyph_reuse.py:69] affine_between failed: M385.8597717285156,136.03179931640625 L449.7751159667969,174.12701416015625 C473.0555419921875,188.09527587890625 451.8915100097656,224.49737548828125 428.611083984375,210.5291748046875 L364.6957702636719,172.433837890625 C341.4153137207031,158.465576171875 362.579345703125,122.06353759765625 385.8597717285156,136.03179931640625 L385.8597717285156,136.03179931640625 Z M447.65869140625,538.9947509765625 L502.2618713378906,486.08465576171875 C521.7327880859375,467.03704833984375 551.7857055664062,497.0899658203125 532.3148193359375,516.1375732421875 L477.71160888671875,569.047607421875 C458.24072265625,588.09521484375 428.18780517578125,558.0423583984375 447.65869140625,538.9947509765625 L447.65869140625,538.9947509765625 Z
W0606 18:20:57.993978 15004 glyph_reuse.py:69] affine_between failed: M517.9232788085938,495.82012939453125 L406.60052490234375,378.57147216796875 C387.9761657714844,358.67724609375 417.6058044433594,328.62432861328125 436.6534423828125,348.5185546875 L547.9761962890625,465.7672424316406 C566.6005249023438,485.661376953125 536.9708862304688,515.7142944335938 517.9232788085938,495.82012939453125 L517.9232788085938,495.82012939453125 Z M618.24072265625,620.6878662109375 L623.743408203125,460.6878356933594 C624.5899047851562,433.597900390625 666.91796875,433.17462158203125 666.0714111328125,460.6878356933594 L660.5687866210938,620.6878662109375 C659.72216796875,647.77783203125 617.3941650390625,648.2010498046875 618.24072265625,620.6878662109375 L618.24072265625,620.6878662109375 Z
W0606 18:20:58.490983 15004 glyph_reuse.py:69] affine_between failed: M612.3148193359375,478.8888854980469 C617.8174438476562,326.08465576171875 616.1243286132812,173.7037353515625 607.6587524414062,20.89947509765625 C605.965576171875,-6.1904296875 648.2936401367188,-6.1904296875 649.9867553710938,20.89947509765625 C658.452392578125,173.28045654296875 660.1455078125,326.08465576171875 654.642822265625,478.8888854980469 C653.7963256835938,505.9788513183594 611.46826171875,506.40216064453125 612.3148193359375,478.8888854980469 L612.3148193359375,478.8888854980469 Z M390.09259033203125,467.4603576660156 C400.6745910644531,321.00531005859375 404.0608215332031,174.55029296875 400.6745910644531,27.67193603515625 C400.2513122558594,0.15875244140625 442.579345703125,0.58203125 443.00262451171875,27.67193603515625 C446.3888854980469,174.55029296875 443.00262451171875,321.00531005859375 432.4206237792969,467.4603576660156 C430.30419921875,494.5502624511719 387.9761657714844,494.5502624511719 390.09259033203125,467.4603576660156 L390.09259033203125,467.4603576660156 Z
W0606 18:20:58.510979 15004 glyph_reuse.py:69] affine_between failed: M437.92327880859375,537.724853515625 L515.806884765625,551.2698364257812 C542.4735107421875,555.9259033203125 531.044921875,596.5608520507812 504.3782958984375,591.90478515625 L426.49468994140625,578.3598022460938 C399.82806396484375,573.7037353515625 411.256591796875,533.0687866210938 437.92327880859375,537.724853515625 L437.92327880859375,537.724853515625 Z M423.53173828125,217.3016357421875 L489.5634765625,170.3175048828125 C511.9973449707031,154.23284912109375 532.738037109375,191.0582275390625 510.7275085449219,206.7196044921875 L444.69573974609375,253.70367431640625 C422.26190185546875,269.78839111328125 401.52117919921875,232.96295166015625 423.53173828125,217.3016357421875 L423.53173828125,217.3016357421875 Z
W0606 18:20:58.701985 15004 glyph_reuse.py:69] affine_between failed: M719.40478515625,289.25927734375 L707.1295776367188,218.14813232421875 C702.4735107421875,191.48150634765625 743.1084594726562,180.05291748046875 747.7645874023438,206.7196044921875 L760.0396728515625,277.8306884765625 C764.6957397460938,304.49737548828125 724.060791015625,315.92596435546875 719.40478515625,289.25927734375 L719.40478515625,289.25927734375 Z M589.8809204101562,576.6666870117188 L655.0661010742188,547.4603271484375 C679.6163940429688,536.4550170898438 701.2036743164062,572.857177734375 676.2301635742188,583.8624267578125 L611.0449829101562,613.0687866210938 C586.4946899414062,624.0740966796875 564.9074096679688,587.6719360351562 589.8809204101562,576.6666870117188 L589.8809204101562,576.6666870117188 Z
W0606 18:20:59.807977 15004 glyph_reuse.py:69] affine_between failed: M469.2460021972656,238.888916015625 L483.2142639160156,17.51324462890625 C484.9073791503906,-9.57672119140625 527.2354125976562,-9.57672119140625 525.5422973632812,17.51324462890625 L511.5740661621094,238.888916015625 C509.88092041015625,265.9788818359375 467.5528869628906,265.9788818359375 469.2460021972656,238.888916015625 L469.2460021972656,238.888916015625 Z M284.2724609375,190.63494873046875 L474.7486572265625,312.116455078125 C497.6058044433594,326.93121337890625 476.4417724609375,363.3333740234375 453.58465576171875,348.5185546875 L263.10845947265625,227.03704833984375 C240.25131225585938,212.22222900390625 261.41534423828125,175.820068359375 284.2724609375,190.63494873046875 L284.2724609375,190.63494873046875 Z
W0606 18:21:03.375030 15004 glyph_reuse.py:69] affine_between failed: M710.9391479492188,391.69317626953125 L664.3782958984375,276.98419189453125 C654.2195434570312,251.58734130859375 694.8544921875,240.58203125 705.0132446289062,265.55560302734375 L751.5740966796875,380.26458740234375 C761.7327880859375,405.661376953125 721.0978393554688,416.66668701171875 710.9391479492188,391.69317626953125 L710.9391479492188,391.69317626953125 Z M321.5211486816406,26.40216064453125 L434.1137390136719,75.92596435546875 C459.0872802734375,86.9312744140625 437.4999694824219,123.33331298828125 412.94970703125,112.3280029296875 L300.3571472167969,62.8043212890625 C275.38360595703125,51.79901123046875 296.97088623046875,15.3968505859375 321.5211486816406,26.40216064453125 L321.5211486816406,26.40216064453125 Z
W0606 18:21:04.303689 15004 glyph_reuse.py:69] affine_between failed: M385.4365234375,536.4550170898438 C396.4417724609375,370.1058349609375 396.86505126953125,204.6031494140625 385.8597717285156,38.25396728515625 C384.1666259765625,11.1640625 426.49468994140625,11.1640625 428.18780517578125,38.25396728515625 C439.193115234375,204.6031494140625 438.7698059082031,370.1058349609375 427.7645568847656,536.4550170898438 C426.0714416503906,563.5449829101562 383.7433776855469,563.5449829101562 385.4365234375,536.4550170898438 L385.4365234375,536.4550170898438 Z M379.51055908203125,575.3968505859375 C388.82275390625,400.15875244140625 387.55291748046875,225.3438720703125 374.8544921875,50.52911376953125 C372.73809814453125,23.439208984375 415.0661315917969,23.439208984375 417.1825256347656,50.52911376953125 C429.8809509277344,225.3438720703125 431.1507873535156,400.15875244140625 421.838623046875,575.3968505859375 C420.56878662109375,602.48681640625 378.2407531738281,602.48681640625 379.51055908203125,575.3968505859375 L379.51055908203125,575.3968505859375 Z
W0606 18:21:04.738688 15004 glyph_reuse.py:69] affine_between failed: M385.8597717285156,571.1640625 L415.91265869140625,25.13226318359375 C417.6058044433594,-1.9576416015625 459.933837890625,-1.9576416015625 458.24072265625,25.13226318359375 L428.18780517578125,571.1640625 C426.49468994140625,598.2539672851562 384.1666259765625,598.2539672851562 385.8597717285156,571.1640625 L385.8597717285156,571.1640625 Z M710.0925903320312,450.952392578125 L719.8280639648438,-113.70361328125 C720.2512817382812,-140.7935791015625 762.5792846679688,-141.2169189453125 762.1561279296875,-113.70361328125 L752.4205932617188,450.952392578125 C751.997314453125,478.0423583984375 709.6693115234375,478.4656066894531 710.0925903320312,450.952392578125 L710.0925903320312,450.952392578125 Z
W0606 18:21:06.533681 15004 glyph_reuse.py:69] affine_between failed: M484.06085205078125,532.6455078125 L409.14019775390625,418.35980224609375 C394.3254089355469,395.50262451171875 430.7275085449219,374.338623046875 445.5423278808594,397.19573974609375 L520.4629516601562,511.48150634765625 C535.2777709960938,534.338623046875 498.8756408691406,555.502685546875 484.06085205078125,532.6455078125 L484.06085205078125,532.6455078125 Z M338.452392578125,519.5238037109375 L330.4100341796875,383.65081787109375 C328.7169189453125,356.56085205078125 371.04498291015625,356.56085205078125 372.73809814453125,383.65081787109375 L380.7803955078125,519.5238037109375 C382.4735107421875,546.61376953125 340.1455078125,546.61376953125 338.452392578125,519.5238037109375 L338.452392578125,519.5238037109375 Z
W0606 18:21:06.552680 15004 glyph_reuse.py:69] affine_between failed: M440.88623046875,329.89422607421875 L545.01318359375,343.86248779296875 C571.6798706054688,347.24871826171875 572.1031494140625,390.00006103515625 545.01318359375,386.19049072265625 L440.88623046875,372.22222900390625 C414.21954345703125,368.83599853515625 413.7962951660156,326.08465576171875 440.88623046875,329.89422607421875 L440.88623046875,329.89422607421875 Z M385.8597717285156,500.05291748046875 L489.14019775390625,512.3280639648438 C515.806884765625,515.291015625 516.2301635742188,558.0423583984375 489.14019775390625,554.6561279296875 L385.8597717285156,542.3809814453125 C359.193115234375,539.41796875 358.76983642578125,496.66668701171875 385.8597717285156,500.05291748046875 L385.8597717285156,500.05291748046875 Z
W0606 18:21:07.207698 15004 glyph_reuse.py:69] affine_between failed: M403.21429443359375,354.02117919921875 L409.14019775390625,122.06353759765625 C409.98675537109375,94.9735107421875 452.3148193359375,94.55035400390625 451.4682312011719,122.06353759765625 L445.5423278808594,354.02117919921875 C444.69573974609375,381.11114501953125 402.3677062988281,381.534423828125 403.21429443359375,354.02117919921875 L403.21429443359375,354.02117919921875 Z M271.5740966796875,516.1375732421875 L497.6058044433594,579.629638671875 C523.8491821289062,586.825439453125 512.8438720703125,627.8836059570312 486.17724609375,620.2645263671875 L260.1455078125,556.7724609375 C233.902099609375,549.5767211914062 244.90740966796875,508.5185241699219 271.5740966796875,516.1375732421875 L271.5740966796875,516.1375732421875 Z
W0606 18:21:07.371687 15004 glyph_reuse.py:69] affine_between failed: M396.0185241699219,584.708984375 L821.4153442382812,628.7301635742188 C848.0819702148438,631.693115234375 848.5052490234375,674.0211791992188 821.4153442382812,671.0582275390625 L396.0185241699219,627.0370483398438 C369.3518371582031,624.0740966796875 368.9285583496094,581.74609375 396.0185241699219,584.708984375 L396.0185241699219,584.708984375 Z M392.208984375,426.40216064453125 L415.0661315917969,6.5079345703125 C416.3359680175781,-20.58197021484375 458.66400146484375,-20.58197021484375 457.3941650390625,6.5079345703125 L434.5370178222656,426.40216064453125 C433.2672119140625,453.4920959472656 390.93914794921875,453.4920959472656 392.208984375,426.40216064453125 L392.208984375,426.40216064453125 Z
W0606 18:21:07.596691 15004 glyph_reuse.py:69] affine_between failed: M611.46826171875,447.98944091796875 L556.0184936523438,332.857177734375 C544.1666259765625,308.306884765625 580.5687866210938,286.7196044921875 592.4205932617188,311.693115234375 L647.870361328125,426.825439453125 C659.72216796875,451.3757019042969 623.320068359375,472.96295166015625 611.46826171875,447.98944091796875 L611.46826171875,447.98944091796875 Z M367.6587219238281,395.50262451171875 L379.9338684082031,265.13226318359375 C382.4735107421875,238.0423583984375 424.80157470703125,238.0423583984375 422.26190185546875,265.13226318359375 L409.98675537109375,395.50262451171875 C407.44708251953125,422.59259033203125 365.1190185546875,422.59259033203125 367.6587219238281,395.50262451171875 L367.6587219238281,395.50262451171875 Z
W0606 18:21:07.955690 15004 glyph_reuse.py:69] affine_between failed: M337.6058044433594,14.12701416015625 L601.3095092773438,83.5450439453125 C627.5528564453125,90.3175048828125 616.547607421875,131.37567138671875 589.8809204101562,124.179931640625 L326.17724609375,54.761962890625 C299.933837890625,47.98944091796875 310.93914794921875,6.93121337890625 337.6058044433594,14.12701416015625 L337.6058044433594,14.12701416015625 Z M415.91265869140625,406.08465576171875 L415.91265869140625,136.03179931640625 C415.91265869140625,108.9417724609375 458.24072265625,108.9417724609375 458.24072265625,136.03179931640625 L458.24072265625,406.08465576171875 C458.24072265625,433.17462158203125 415.91265869140625,433.17462158203125 415.91265869140625,406.08465576171875 L415.91265869140625,406.08465576171875 Z
W0606 18:21:09.387684 15004 glyph_reuse.py:69] affine_between failed: M447.65869140625,538.9947509765625 L502.2618713378906,486.08465576171875 C521.7327880859375,467.03704833984375 551.7857055664062,497.0899658203125 532.3148193359375,516.1375732421875 L477.71160888671875,569.047607421875 C458.24072265625,588.09521484375 428.18780517578125,558.0423583984375 447.65869140625,538.9947509765625 L447.65869140625,538.9947509765625 Z M524.69580078125,203.3333740234375 L546.706298828125,130.52911376953125 C554.7486572265625,104.2857666015625 595.3836059570312,115.71435546875 587.3412475585938,141.95770263671875 L565.3306884765625,214.76190185546875 C557.288330078125,241.00531005859375 516.6534423828125,229.57672119140625 524.69580078125,203.3333740234375 L524.69580078125,203.3333740234375 Z
W0606 18:21:12.570699 15004 glyph_reuse.py:69] affine_between failed: M502.2618713378906,476.3492431640625 L497.6058044433594,338.35980224609375 C496.7592468261719,310.8465576171875 539.0872802734375,311.26983642578125 539.933837890625,338.35980224609375 L544.5899047851562,476.3492431640625 C545.4365234375,503.8624572753906 503.10845947265625,503.43914794921875 502.2618713378906,476.3492431640625 L502.2618713378906,476.3492431640625 Z M574.2195434570312,36.98419189453125 L688.9285888671875,-34.9735107421875 C712.208984375,-49.36505126953125 733.373046875,-12.96295166015625 710.0925903320312,1.4285888671875 L595.3836059570312,73.38629150390625 C572.1031494140625,87.77777099609375 550.9391479492188,51.375732421875 574.2195434570312,36.98419189453125 L574.2195434570312,36.98419189453125 Z
W0606 18:21:12.665682 15004 glyph_reuse.py:69] affine_between failed: M359.193115234375,153.38629150390625 L408.29364013671875,171.1640625 C433.6904602050781,180.4761962890625 422.6851806640625,221.11114501953125 396.86505126953125,211.7989501953125 L347.7645263671875,194.02117919921875 C322.3677062988281,184.70904541015625 333.37298583984375,144.07403564453125 359.193115234375,153.38629150390625 L359.193115234375,153.38629150390625 Z M473.0555419921875,376.03173828125 L524.69580078125,365.873046875 C551.3624267578125,360.79364013671875 562.7909545898438,401.4285888671875 536.124267578125,406.5079345703125 L484.484130859375,416.66668701171875 C457.8174743652344,421.74609375 446.3888854980469,381.11114501953125 473.0555419921875,376.03173828125 L473.0555419921875,376.03173828125 Z
W0606 18:21:12.861685 15004 glyph_reuse.py:69] affine_between failed: M618.24072265625,620.6878662109375 L623.743408203125,460.6878356933594 C624.5899047851562,433.597900390625 666.91796875,433.17462158203125 666.0714111328125,460.6878356933594 L660.5687866210938,620.6878662109375 C659.72216796875,647.77783203125 617.3941650390625,648.2010498046875 618.24072265625,620.6878662109375 L618.24072265625,620.6878662109375 Z M373.58465576171875,255.82012939453125 L377.3941650390625,95.82012939453125 C378.2407531738281,68.730224609375 420.56878662109375,68.306884765625 419.7221984863281,95.82012939453125 L415.91265869140625,255.82012939453125 C415.0661315917969,282.9100341796875 372.73809814453125,283.3333740234375 373.58465576171875,255.82012939453125 L373.58465576171875,255.82012939453125 Z
W0606 18:21:13.796681 15004 glyph_reuse.py:69] affine_between failed: M295.7010498046875,447.1428527832031 L274.11376953125,325.23809814453125 C269.4576721191406,298.5714111328125 310.09259033203125,287.14288330078125 314.7486877441406,313.8095703125 L336.3359680175781,435.71429443359375 C340.9920654296875,462.3809509277344 300.3571472167969,473.8095397949219 295.7010498046875,447.1428527832031 L295.7010498046875,447.1428527832031 Z M768.5053100585938,271.05816650390625 L894.2195434570312,283.3333740234375 C921.3094482421875,285.873046875 921.3094482421875,328.20111083984375 894.2195434570312,325.661376953125 L768.5053100585938,313.38629150390625 C741.415283203125,310.8465576171875 741.415283203125,268.51849365234375 768.5053100585938,271.05816650390625 L768.5053100585938,271.05816650390625 Z
W0606 18:21:17.081682 15004 glyph_reuse.py:69] affine_between failed: M802.36767578125,410.3175048828125 L889.9866943359375,447.566162109375 C914.9602661132812,458.1481628417969 893.3729858398438,494.5502624511719 868.8226928710938,483.96826171875 L781.2036743164062,446.7195739746094 C756.2301025390625,436.1375732421875 777.8174438476562,399.7354736328125 802.36767578125,410.3175048828125 L802.36767578125,410.3175048828125 Z M769.3518676757812,321.00531005859375 L865.01318359375,337.0899658203125 C891.6798706054688,341.74603271484375 880.2512817382812,382.3809814453125 853.5846557617188,377.724853515625 L757.9232788085938,361.6402587890625 C731.256591796875,356.984130859375 742.6851806640625,316.3492431640625 769.3518676757812,321.00531005859375 L769.3518676757812,321.00531005859375 Z
W0606 18:21:17.782690 15004 glyph_reuse.py:69] affine_between failed: M577.1824951171875,338.35980224609375 L597.9232788085938,238.888916015625 C603.4259033203125,212.22222900390625 644.0608520507812,223.65081787109375 638.5581665039062,250.31744384765625 L617.8174438476562,349.78839111328125 C612.3148193359375,376.45501708984375 571.6798706054688,365.0264892578125 577.1824951171875,338.35980224609375 L577.1824951171875,338.35980224609375 Z M356.6534423828125,370.952392578125 L454.0079345703125,391.26983642578125 C480.6745910644531,396.77252197265625 469.2460021972656,437.40740966796875 442.579345703125,431.90478515625 L345.224853515625,411.5872802734375 C318.5581970214844,406.08465576171875 329.98675537109375,365.44970703125 356.6534423828125,370.952392578125 L356.6534423828125,370.952392578125 Z
W0606 18:21:18.428692 15004 glyph_reuse.py:69] affine_between failed: M445.1190490722656,625.7672119140625 L251.6798858642578,354.86773681640625 C235.59523010253906,332.43389892578125 272.420654296875,311.693115234375 288.0820007324219,333.70367431640625 L481.5211486816406,604.6031494140625 C497.6058044433594,627.0370483398438 460.7803955078125,647.77783203125 445.1190490722656,625.7672119140625 L445.1190490722656,625.7672119140625 Z M739.7222290039062,569.8941650390625 L722.3677368164062,226.19049072265625 C721.0978393554688,199.1005859375 763.4259033203125,199.1005859375 764.6957397460938,226.19049072265625 L782.0502319335938,569.8941650390625 C783.3201293945312,596.984130859375 740.9920654296875,596.984130859375 739.7222290039062,569.8941650390625 L739.7222290039062,569.8941650390625 Z
I0606 18:21:18.799691 15004 __init__.py:47] Pre-processing glyphs
I0606 18:21:19.392682 15004 base.py:178] Running DecomposeComponentsFilter on AnEmojiFamily-Regular
I0606 18:21:19.399682 15004 base.py:178] Running CubicToQuadraticFilter on AnEmojiFamily-Regular
I0606 18:21:20.288681 15004 cubicToQuadratic.py:46] New spline lengths: 1: 5526, 2: 11913, 3: 18577, 4: 1807, 5: 638, 6: 120, 7: 16
I0606 18:21:20.288681 15004 __init__.py:243] Building OpenType tables
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\nanoemoji\write_font.py", line 838, in <module>
    app.run(main)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\absl\app.py", line 312, in run
    _run_main(main, args)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\absl\app.py", line 258, in _run_main
    sys.exit(main(argv))
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\nanoemoji\write_font.py", line 831, in main
    ufo, ttfont = _generate_color_font(font_config, inputs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\nanoemoji\write_font.py", line 765, in _generate_color_font
    ttfont = _make_ttfont(config, ufo, color_glyphs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\nanoemoji\write_font.py", line 229, in _make_ttfont
    ttfont = ufo2ft.compileTTF(ufo, overlapsBackend="pathops")
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\__init__.py", line 250, in compileTTF
    return call_postprocessor(otf, ufo, glyphSet, **kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\__init__.py", line 81, in call_postprocessor
    postProcessor = postProcessorClass(otf, ufo, glyphSet=glyphSet)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\postProcessor.py", line 50, in __init__
    self.otf = _reloadFont(otf)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ufo2ft\postProcessor.py", line 394, in _reloadFont
    font.save(stream)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\ttFont.py", line 201, in save
    writer_reordersTables = self._save(tmp)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\ttFont.py", line 248, in _save
    self._writeTable(tag, writer, done, tableCache)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\ttFont.py", line 696, in _writeTable
    self._writeTable(masterTable, writer, done, tableCache)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\ttFont.py", line 700, in _writeTable
    tabledata = self.getTableData(tag)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\ttFont.py", line 722, in getTableData
    return self.tables[tag].compile(self)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\ttLib\tables\_m_a_x_p.py", line 51, in compile
    data = data + sstruct.pack(maxpFormat_1_0_add, self)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\fontTools\misc\sstruct.py", line 75, in pack
    data = struct.pack(*(formatstring,) + tuple(elements))
struct.error: 'H' format requires 0 <= number <= 65535
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\Scripts\nanoemoji.exe\__main__.py", line 7, in <module>
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\nanoemoji\nanoemoji.py", line 761, in main
    app.run(_run)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\absl\app.py", line 312, in run
    _run_main(main, args)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\absl\app.py", line 258, in _run_main
    sys.exit(main(argv))
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\nanoemoji\nanoemoji.py", line 756, in _run
    maybe_run_ninja(build_file)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\nanoemoji\ninja.py", line 125, in maybe_run_ninja
    subprocess.run(ninja_cmd, check=True)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-C', 'D:\\Desktop\\coding\\svg2font\\test\\test-strokesvg\\build']' returned non-zero exit status 1.
@anthrotype
Copy link
Member

anthrotype commented Jun 6, 2023

compiling maxp is blowing up, maybe you've oveflown the maximum number of glyphs (65535) that an OpenType font can contains at the moment. How many SVGs did you pass as input?

@NightFurySL2001
Copy link
Author

Uhhh... is 700 too much? 😓

@anthrotype
Copy link
Member

no, that should be fine..

Could you please try to apply this patch to a local clone of github.com/fonttools/fonttools and install fonttools from that directory in editable mode (pip install -e .) and see what you get:

diff --git a/Lib/fontTools/misc/sstruct.py b/Lib/fontTools/misc/sstruct.py
index d35bc9a5c..6f54f769c 100644
--- a/Lib/fontTools/misc/sstruct.py
+++ b/Lib/fontTools/misc/sstruct.py
@@ -72,7 +72,12 @@ def pack(fmt, obj):
         elif isinstance(value, str):
             value = tobytes(value)
         elements.append(value)
-    data = struct.pack(*(formatstring,) + tuple(elements))
+    try:
+        data = struct.pack(*(formatstring,) + tuple(elements))
+    except struct.error:
+        print("formatstring:", formatstring)
+        print("elements:", elements)
+        raise
     return data

@NightFurySL2001
Copy link
Author

struct.error: 'H' format requires 0 <= number <= 65535
formatstring: >HHHHHHHHHHHHH
elements: [81, 2, 152196, 7464, 1, 0, 0, 0, 0, 0, 0, 7464, 1]
ninja: build stopped: subcommand failed.

@anthrotype
Copy link
Member

the third field of maxp is maxPoints, there's a glyph that contains more than the maximum number of points (also an unsigned short)...

@NightFurySL2001
Copy link
Author

These source files are raw data input from one of the testers. All of these are stroked paths made in Adobe Illustrator. Using only 4 SVG, it seems that all the glyph are concentrated on uni000A, with the remaining strokes on separate glyphs.

@anthrotype
Copy link
Member

have you been able to indentify the offending SVG file that makes the maxp explode? Could you upload here or send privately via email so I can take a look?
We should definitely improve the error messages

@NightFurySL2001
Copy link
Author

All the svg are uploaded in the zip file in the first comment. I think it's probably the --glyphmap_file csv file not working. Using even more glyphs it shows that all the glyphs are imported into uni000A, not to individual glyphs, probably why it exploded.
image

csv format:

Artboard 2.svg,,醍

@anthrotype
Copy link
Member

anthrotype commented Jun 6, 2023

OK, I see. So the --glyphmap_file option is a private flag of the nanoemoji.write_fonts submodule, which is not meant to be passed directly to the main nanoemoji CLI tool. Right now nanoemoji attempts to write a glyphmap csv file by parsing the svg input filenames (guessing the codepoints from the file name, e.g. emoji_u1F055_A425.svg -- I made this up). The default implementation is in nanoemoji.write_glyphmap, which takes the input SVG files and writes the glyphmap CSV.
One can override that by providing a custom --glyphmap_generator script with a similar interface but implementing a different logic. This is quite complicated feature and I've never liked very much, for it requires a user to write python code.
I think if one already has a glyphmap in CSV they should be able to simply pass it to nanoemoji with the existing --glyphmap_file option, just like you did.
I started to implement this in #454, please have a try if you can (you can clone namoemoji, checkout the 'custom-glyphmap' branch and install editable from there).

Note that the CSV must contain four (or more) columns: the first two are respectively the SVG and PNG file names (usually you only need the first and can leave the second one empty, it's only used for bitmap color tables); the third column is the desired glyph name, and the fourth, fifth, etc. are the unicode codepoints. These must be in hexadecimal format, so instead of writing it as text like you did inside "test-strokesvg.csv", the codepoint column is expected to look like 918D. If the codepoints are left empty, no entry will be added to the cmap table, which makes a glyph practically unreachable unless you have other means (GSUB) to get to it, so in general it's advisable that you add at least one codepoint. Multiple codepoints are interpreted not as alternative character mappings for the same glyph, but rather as a rule for generating a GSUB ligature to substitute that glyph when the sequence of codepoints appear in a string (this is meant to support emoji sequences). When the glyph_name (third) column is left empty, in that PR of mine, I'm using the codepoints to create a glyph name (some glyph name is required to identify glyphs internally, but are not going to be stored in the font unless --keep_glyph_names option is used).

I hope this helps a bit. Thanks for trying out out tools and providing feedback!

@NightFurySL2001
Copy link
Author

NightFurySL2001 commented Jun 6, 2023

I see, thank you. I would also like to ask if it is possible to not separate each element as its own glyph since I don't see such options? I understand it is used for glyf colour font (glyf_colr_0, glyf_colr_1), but I'm not sure why glyf has them seperated.

@anthrotype
Copy link
Member

Sorry I don't understand what you mean when you say "not separate each element as its own glyph", can you please clarify/make example? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants