You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just discovered this problem. By modifying it and adding other key information, I got what I needed.
I've modified these functions below so that you can get a more specific message and use your own judgment to suit your needs. This change improves flexibility, but also increases the complexity for users.
In addition, I also tried to support automatic encoding detection under mac fonts.
The most common combinations tend to be the following:
Mac (1,0,0,1) Font Family: FZLanTingYuan-DB-GBK
Mac (1,0,0,2) Font Subfamily: Regular
Mac (1,0,0,3) Unique Identifier: Founder:FZLanTingYuan-DB-GBK Regular
Mac (1,0,0,4) Full Name: FZLanTingYuan-DB-GBK
Mac (1,0,0,5) Version: 1.00
Mac (1,0,0,6) PostScript Name: FZLANTY_ZHONGK--GBK1-0
Microsoft (3,1,1033,1) Font Family: FZLanTingYuan-DB-GBK
Microsoft (3,1,1033,2) Font Subfamily: Regular
Microsoft (3,1,1033,3) Unique Identifier: Founder:FZLanTingYuan-DB-GBK Regular
Microsoft (3,1,1033,4) Full Name: FZLanTingYuan-DB-GBK
Microsoft (3,1,1033,5) Version: 1.00
2052: Language ID
Microsoft (3,1,1033,6) PostScript Name: FZLANTY_ZHONGK--GBK1-0
Microsoft (3,1,2052,1) Font Family: 方正兰亭圆_GBK_中
Microsoft (3,1,2052,2) Font Subfamily: Regular
Microsoft (3,1,2052,3) Unique Identifier: Founder:方正兰亭圆_GBK_中 Regular
Microsoft (3,1,2052,4) Full Name: 方正兰亭圆_GBK_中
(BTW: https://github.com/ConradIrwin/font is a good program. Its info tool can list the raw data in detail, which is helpful for your debugging.)
If I don't modify it, it just discards/overwrites this information.
function getFontCopyright($platformID, $platformSpecificID, $languageID)
function getFontName($platformID, $platformSpecificID, $languageID)
function getFontSubfamily($platformID, $platformSpecificID, $languageID)
function getFontSubfamilyID($platformID, $platformSpecificID, $languageID)
function getFontFullName($platformID, $platformSpecificID, $languageID)
function getFontVersion($platformID, $platformSpecificID, $languageID)
function getFontPostscriptName($platformID, $platformSpecificID, $languageID)
@lslqtz feel free to submit a PR with those changes. Happy to review and include in a future release.
I'm using a very simple modification, so I'm not sure I can guarantee its backwards compatibility, especially since I don't fully analyze and understand its replacement behavior. But this modification did solve my problem, so I posted these usages and cases in issues that may be similar.
Since these new parameters are required in my modification, it may become a breaking change.
(Another problem is that I only modified the TrueType function, which may lead to inconsistent usage between different font type)
Activity
bsweeney commentedon Jan 11, 2024
If you're still interested in this can you clarify what you want to retrieve?
lslqtz commentedon Feb 11, 2024
I just discovered this problem. By modifying it and adding other key information, I got what I needed.
I've modified these functions below so that you can get a more specific message and use your own judgment to suit your needs. This change improves flexibility, but also increases the complexity for users.
In addition, I also tried to support automatic encoding detection under mac fonts.
lslqtz@cc1a5a8
The most common combinations tend to be the following:
(BTW: https://github.com/ConradIrwin/font is a good program. Its info tool can list the raw data in detail, which is helpful for your debugging.)
Specifically:
If I don't modify it, it just discards/overwrites this information.
Usage like this:
bsweeney commentedon Feb 11, 2024
@lslqtz feel free to submit a PR with those changes. Happy to review and include in a future release.
lslqtz commentedon Feb 12, 2024
I'm using a very simple modification, so I'm not sure I can guarantee its backwards compatibility, especially since I don't fully analyze and understand its replacement behavior. But this modification did solve my problem, so I posted these usages and cases in issues that may be similar.
Since these new parameters are required in my modification, it may become a breaking change.
(Another problem is that I only modified the TrueType function, which may lead to inconsistent usage between different font type)
bsweeney commentedon Feb 12, 2024
Thank you for the follow up. I'll review your changes and see how we can adapt them.
Also, if you have any sample fonts for testing that would be great.