Closed gregnix closed 6 months ago
Can you send some snippet of you code to test ?
Cannot restore the condition that led to the error. Was with one of the examples.
May repeat mistakes. I have two different DejaVuSansCondensed.ttf Calling the example utf8.tcl With the 1) DejaVuSansCondensed.ttf the proc proc ::tclfpdf::ttf_getCMAP4 from ttf_font.tcl at the point with set $offset passed through.
1.) 667K 10. Aug 2023 DejaVuSansCondensed.ttf
::tclfpdf::ttf_getCMAP4 can't read "offset": no such variable while executing "set $offset [expr ($unichar - $startCount($n)) * 2 + $idRangeOffset($n)]" (procedure "::tclfpdf::ttf_getCMAP4" line 41) invoked from within "::tclfpdf::ttf_getCMAP4 $unicode_cmap_offset" (procedure "::tclfpdf::ttf_extractInfo" line 242) invoked from within "::tclfpdf::ttf_extractInfo" (procedure "ttf_getMetrics" line 27) invoked from within "ttf_getMetrics $ttffile" (procedure "AddFont" line 39) invoked from within "AddFont "DejaVu" "" "DejaVuSansCondensed.ttf" 1"
after correction of ttf_font.tcl proc ::tclfpdf::ttf_getCMAP4
row 1091 and 1092 set $offset after set offset
dejavusanscondensed.mtx.tcl
set name "DejaVuSansCondensed" ;
set type "TTF";
array set desc {ItalicAngle 0.0 Flags 4 CapHeight 928 MissingWidth 540 FontBBox {[ -918 -463 1614 1232 ]} Descent -236 Ascent 928 StemV 87};
set up -20;
set ut 44;
set ttffile "~/development/src/tcktk/pdflib/tclfpdf-1.6/font/DejaVuSansCondensed.ttf";
set originalsize 682828;
set fontkey "dejavu";
2.) 665K 18. Sep 2021 DejaVuSansCondensed.ttf
dejavusanscondensed.mtx.tcl
set name "DejaVuSansCondensed" ;
set type "TTF";
array set desc {ItalicAngle 0.0 Flags 4 CapHeight 928 MissingWidth 540 FontBBox {[ -918 -463 1614 1232 ]} Descent -236 Ascent 928 StemV 87};
set up -63;
set ut 44;
set ttffile "~/development/src/tcktk/pdflib/tclfpdf-1.6/font/DejaVuSansCondensed.ttf";
set originalsize 680264;
set fontkey "dejavu";
Your observation is correct. I have the second version ("set originalsize 680264;") and in this case these lines aren't called. I'll fix in 1.7
ttf_font.tcl proc ::tclfpdf::ttf_getCMAP4
row 1091 and 1092
Therefore it produces an error for me