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

Merged
merged 1 commit into from
Dec 30, 2024
Merged

Conversation

RealityRipple
Copy link
Contributor

@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.
@L2jLiga L2jLiga merged commit 9b367ed into L2jLiga:master Dec 30, 2024
@L2jLiga
Copy link
Owner

L2jLiga commented Dec 30, 2024

Thanks a lot, released as 5.1.0

And sorry for long delay 😅

@RealityRipple RealityRipple deleted the zero-width branch January 4, 2025 19:05
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.

2 participants