Skip to content
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

The width of 凰 (U+51f0) in Sans JP looks odd. #523

Open
ryota2357 opened this issue May 18, 2023 · 0 comments
Open

The width of 凰 (U+51f0) in Sans JP looks odd. #523

ryota2357 opened this issue May 18, 2023 · 0 comments

Comments

@ryota2357
Copy link

ryota2357 commented May 18, 2023

Problem

IBM-Plex-Sans-JP

In some weight, the glyph width of 凰 (U+51f0) is not 1000. (Other Kanji glyph width are 1000)

weight width
Bold 1000
Text 1001
Thin 1000
Light 1001
Medium 1001
Regular 1002
SemiBold 1000
ExtraLight 1001

Are they expected or bug?

Check script and output

  1. Download TrueType.zip from Release (v6.3.0)
  2. Save following python script as test.py
  3. Excute fontforge -lang=py -script test.py
import fontforge

TTF_FILES = [
    "TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Bold.ttf",
    "TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Text.ttf",
    "TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Thin.ttf",
    "TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Light.ttf",
    "TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Medium.ttf",
    "TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Regular.ttf",
    "TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-SemiBold.ttf",
    "TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-ExtraLight.ttf"
]


def test(range_):
    for codepoint in range_:
        try:
            glyph = font[codepoint]
            width = glyph.width
            if width != 1000:
                unicode = glyph.unicode
                name = glyph.glyphname
                print(hex(codepoint), hex(unicode), name, width)
        except TypeError:  # No such glyph
            pass


for ttf in TTF_FILES:
    font = fontforge.open(ttf)
    print("\n>>>", ttf)
    test(range(0x2e8e, 0xfa6a))
    test(range(0x20b9f, 0x2f920))
    test(range(0x110161, 0x110326))
Copyright (c) 2000-2023. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20230101
 Based on sources from 2023-01-01 05:27 UTC-D.
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table

>>> TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Bold.ttf
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table

>>> TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Text.ttf
0x51f0 0x51f0 uni51F0 1001
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table

>>> TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Thin.ttf
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table

>>> TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Light.ttf
0x51f0 0x51f0 uni51F0 1001
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table

>>> TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Medium.ttf
0x51f0 0x51f0 uni51F0 1001
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table

>>> TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-Regular.ttf
0x51f0 0x51f0 uni51F0 1002
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table
警告: 'name' テーブルの Mac と Windows の項目で文字列 Family が言語 English (US)
      版において一致しません.
 Mac の文字列: IBM Plex Sans JP Smbld
 Windows の文字列: IBM Plex Sans JP SmBld

>>> TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-SemiBold.ttf
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table

>>> TrueType/IBM-Plex-Sans-JP/unhinted/IBMPlexSansJP-ExtraLight.ttf
0x51f0 0x51f0 uni51F0 1001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant