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
Noto Sans Mono CJK fonts have no spacing property #122
Comments
I scanned a latest Mono font and fc-scan showed:
Expected results: |
@behdad : you updated fc-scan man page last time, so you might know... how do we set spacing in the sources (this could be a source issue or a pipeline issue)? |
Oh, not 100 (FC_MONO), it should be 90 (FC_DUAL). |
Inquiring minds would like to know what particular table settings or font attributes trigger the fc-scan spacing value 90 (FC_DUAL). 🤔 |
It checks the advance widths of all cmap characters. If there's only two values and one is approximately twice the other, it sets FC_DUAL. Now, checking the code, I don't think it ignores zero advance widths. That doesn't sound right to me. |
Any progress on this issue? apparently Noto Sans Mono CJK fonts has so many advance widths there. if checking the advance widths are the right way to figure out, that looks not monospaced fonts to me. |
Humm. What's Noto Sans Mono CJK? Do we even have such a font? |
Such fonts were built only for two weights, Regular and Bold, and differ from the standard (non-Mono) fonts by mapping the ASCII range to half-width glyphs. One of my colleagues deployed Source Han Code JP, a derivative of Source Han Sans (Japanese) that used a different approach, but there are still issues with some environments, in terms of treating the font as monospaced. For example, see Issue notofonts/noto-fonts#14 in its repository. Some of our testing even suggested that TrueType fonts might be special-cased for this. |
@behdad that is one of faces in NotoSansCJK-*.ttc. |
@kenlunde That's true. and FC_DUAL can be used to take care of such fonts though, Noto Sans Mono CJK isn't considered a monospaced font even so far, properly speaking, not considered FC_DUAL but FC_PROPOTIONAL. |
Emmm... @behdad
fontconfig: src/fcfreetype.c
I think |
@tagoh I have seen references to FC_DUAL before, but what has never been clear to me, as a font developer, is where in the font that this flag is set, in terms of which 'sfnt' table and which specific table setting. The setting seems to be external to the font resource. |
Right. Thanks :) |
Yes, fontconfig checks all the advances in the font, and if they only have two non-zero values, one double the other, it assigns FC_DUAL to the font. |
@behdad The Source Han Code JP fonts have two primary non-zero glyph advances: 1000 and 667. There are also a much smaller number of other glyph advances, such as 2000 and 3000 for U+2E3A and U+2E3B, respectively, 500 for a small number of genuine half-width glyphs, 920 for Compatibility Jamo (not sure why these glyphs are included in a Japanese-specific font), and 250 for two Korean-specific characters (again, not sure why these glyphs were included). The "double the other" probably needs to be reconsidered as two different non-zero advances to cover the case of 667 and 1000. cc @hatchzo |
This seems out of scope to me, and like a bug to report in font-config. |
Same as https://github.com/googlei18n/noto-fonts/issues/1128.
I also wrote somethings about the reason why KDE Konsole and other Qt application does not consider Noto Sans Mono (CJK) monospace fonts in https://github.com/googlei18n/noto-fonts/issues/1128#issuecomment-379988287.
The text was updated successfully, but these errors were encountered: