-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
FR: [show CJK font full name instead font family name when preview fonts] #6763
Comments
No alternative name seems to be accessible from the font library we use: |
in the doc, I found this. maybe useful. family_name The face's family name. This is an ASCII string, usually in English, that describes the typeface's family (like ‘Times New Roman’, ‘Bodoni’, ‘Garamond’, etc). This is a least common denominator used to list fonts. Some formats (TrueType & OpenType) provide localized and Unicode versions of this string. Applications should use the format-specific interface to access them. Can be NULL (e.g., in fonts embedded in a PDF file). In case the font doesn't provide a specific family name entry, FreeType tries to synthesize one, deriving it from other name entries. |
I read that :) and what I meant is that our current library does not have the interface to access them. And adding other libraries just to get them feel a bit heavy :/ |
Does HB have methods to read those? (Also: that kind of metadata is often quirky and/or bogus and/or wrong and/or outdated, so, here be dragons anyway). |
Possibly: https://harfbuzz.github.io/harfbuzz-hb-ot-name.html /**
* hb_ot_name_id_t:
* @HB_OT_NAME_ID_INVALID: Value to represent a nonexistent name ID.
*
* An integral type representing an OpenType 'name' table name identifier.
* There are predefined name IDs, as well as name IDs return from other
* API. These can be used to fetch name strings from a font face.
*
* Since: 2.0.0
**/
enum
{
HB_OT_NAME_ID_COPYRIGHT = 0,
HB_OT_NAME_ID_FONT_FAMILY = 1,
HB_OT_NAME_ID_FONT_SUBFAMILY = 2,
HB_OT_NAME_ID_UNIQUE_ID = 3,
HB_OT_NAME_ID_FULL_NAME = 4,
HB_OT_NAME_ID_VERSION_STRING = 5,
HB_OT_NAME_ID_POSTSCRIPT_NAME = 6,
HB_OT_NAME_ID_TRADEMARK = 7,
HB_OT_NAME_ID_MANUFACTURER = 8,
HB_OT_NAME_ID_DESIGNER = 9,
HB_OT_NAME_ID_DESCRIPTION = 10,
HB_OT_NAME_ID_VENDOR_URL = 11,
HB_OT_NAME_ID_DESIGNER_URL = 12,
HB_OT_NAME_ID_LICENSE = 13,
HB_OT_NAME_ID_LICENSE_URL = 14,
/*HB_OT_NAME_ID_RESERVED = 15,*/
HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY = 16,
HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY = 17,
HB_OT_NAME_ID_MAC_FULL_NAME = 18,
HB_OT_NAME_ID_SAMPLE_TEXT = 19,
HB_OT_NAME_ID_CID_FINDFONT_NAME = 20,
HB_OT_NAME_ID_WWS_FAMILY = 21,
HB_OT_NAME_ID_WWS_SUBFAMILY = 22,
HB_OT_NAME_ID_LIGHT_BACKGROUND = 23,
HB_OT_NAME_ID_DARK_BACKGROUND = 24,
HB_OT_NAME_ID_VARIATIONS_PS_PREFIX = 25,
HB_OT_NAME_ID_INVALID = 0xFFFF
};
typedef unsigned int hb_ot_name_id_t; I don't think crengine should be the proxy for that, and neither xtext. |
No need to bother HB with this. It would just go back to freetype and ask it anyway :) https://www.freetype.org/freetype2/docs/reference/ft2-sfnt_names.html That said, interpreting this stuff is pretty annoying. Add to this that a lot of chinese fonts just plaster those strings in big5/gb, with software having to do manual hacks to display stuff properly. |
The Chinese characters outside the parenthesis are indeed the font name I want to display. |
Full binding, so as to avoid type dep annoynances in the future. Primarily for mupdf font queries, but perhaps also more generally cf koreader/koreader#6763
Full binding, so as to avoid type dep annoyances in the future. Primarily for mupdf font queries, but perhaps also more generally, cf koreader/koreader#6763
This is necessary for proper language support in mupdf with arbitrary fonts in html/pdf - mupdf expects a real font server for its callbacks, we're told abstract typeface, script and language that must be accounted for whenever offering close-kin substitutes of a typeface. There are marginal uses for this elsewhere, eg. localized font names in UI - koreader/koreader#6763
Info about each face (l10n, name, family, style etc) is now cached offline, so fonts can be queried ahead of time. Fixes #6763
Does your feature request involve difficulty completing a task? Please describe.
not difficult
Describe the solution you'd like
when preview font name, if detect CJK font, showing the full font name which has CJK characters, instead showing the font family name which only contain english characters.
The text was updated successfully, but these errors were encountered: