File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 66- Update linebreak to 1.1
77- Add support for spot colors
88- Fix sets tab order to "Structure" when a document is tagged
9+ - Fix font cache collision for fonts with missing postscript name or bad TTF metadata
910- Fix measuring text when OpenType features are passed in to .text()
1011
1112### [ v0.15.2] - 2024-12-15
Original file line number Diff line number Diff line change 11import PDFFontFactory from '../font_factory' ;
22
3+ const isEqualFont = ( font1 , font2 ) => {
4+ // compare font name table
5+ return ( JSON . stringify ( font1 . font . _tables ?. name ?. records ) === JSON . stringify ( font2 . font . _tables ?. name ?. records ) )
6+ }
7+
38export default {
49 initFonts ( defaultFont = 'Helvetica' ) {
510 // Lookup table for embedded fonts
@@ -52,7 +57,7 @@ export default {
5257
5358 // check for existing font familes with the same name already in the PDF
5459 // useful if the font was passed as a buffer
55- if ( ( font = this . _fontFamilies [ this . _font . name ] ) ) {
60+ if ( ( font = this . _fontFamilies [ this . _font . name ] ) && isEqualFont ( this . _font , font ) ) {
5661 this . _font = font ;
5762 return this ;
5863 }
You can’t perform that action at this time.
0 commit comments