-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add Vietnamese glyphs #137
Open
Nekosha
wants to merge
11
commits into
IdreesInc:main
Choose a base branch
from
Nekosha:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The last two commits should produce a font with almost identical rendering to the current Minecraft font. However, in my opition, the readability of it is not great. |
Nekosha
force-pushed
the
main
branch
2 times, most recently
from
February 19, 2024 08:32
a2306b8
to
b85f12b
Compare
Various scripts have diacritics on positions other than the top of base characters. This commit adds support for the (optional) `placement` key in diacritic.json, allowing diacritics to be placed in any of the four positions: above, below, to the left, and to the right of the glyph. The default when not specified is "above". The placement respects the spacing specified by the `diacriticSpace` key in characters.json.
This allows to define a glyph with multiple diacritics attached. Currently overlaps are not handled (spacing is currently shared for all of them), meaning stacking diacritics in the same direction is not possible.
This adds various missing glyphs for Vietnamese. Note that some characters require multiple diacritics in different positions. There is a hack in diacritics.json to force monocraft.py to include many glyphs in the generation step. For example, the glyph "LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW" contain two diacritics `circumflex` and `dot_below`. generate_diacritics.py parses this as containing one diacritic: `circumflex_and_dot_below`, which it will not find in diacritics.json without this hack, and thus the glyph will not be generated. For a proper fix, the logic to determine which diacritics should be considered (lines 37-38, generate_diacritics.py) should be fixed to consult the list in characters.json instead.
This commit adds support for two optional keys in diacritics.json: offsetX and offsetY. This allows the glyph to be shifted relative to the base position.
Some Vietnamese glyphs are very tall with their diacritics, which causes the top of them to sometimes be cut off in some programs. This raises the font ascent by 1 pixel size to accomodate those glyphs. As a side effect, however, this also messes with font sizing in a lot of programs.
The original variant looks better in text, but is different from the font in-game.
The original variant looks better in text, but is different from the font in-game.
The last size bump did not take into account capital letters.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request add various glyphs for Vietnamese.
Many related changes to diacritic handling are also implemented, please see the individual commits for details.
Summary of changes: