Skip to content

Add Zero Width Character Support#45

Merged
L2jLiga merged 1 commit intoL2jLiga:masterfrom
RealityRipple:zero-width
Dec 30, 2024
Merged

Add Zero Width Character Support#45
L2jLiga merged 1 commit intoL2jLiga:masterfrom
RealityRipple:zero-width

Conversation

@RealityRipple
Copy link
Copy Markdown
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
Copy Markdown
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