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

Add Zero Width Character Support #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RealityRipple
Copy link

@RealityRipple RealityRipple commented Mar 31, 2024

Created a new 'zerowidth' option, which is an array of characters that should be rendered with no width or side bearings.

The relevant SVG file(s) still need to exist, but a 0 wide viewport object should suffice, so long as it has some simple vertical path inside to parse.

Example use, with the Keycap character, u20e3:

20e3.svg:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 0 36"><path fill="#FFFFFF00" d="M0 0 V 36 z"/></svg>

Gruntfile.js:

options: {
    ...
    autoHint: false,
    zerowidth: ['20e3'],
    ...
}

You can even make a character have a negative width to cause an overlap on the previous character, allowing for modifiers.

New 'zerowidth' option is an array of characters that should be rendered with no width or side bearings. The relevant SVG file(s) still need to exist, but a `0` wide viewport object should suffice, so long as it has some simple vertical path inside to parse.
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

Successfully merging this pull request may close these issues.

1 participant