10000 Add way to enable OVERLAP_SIMPLE or OVERLAP_COMPOUND · Issue #681 · googlefonts/fontmake · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add way to enable OVERLAP_SIMPLE or OVERLAP_COMPOUND #681

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 ou 8000 r terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
moyogo opened this issue Jul 8, 2020 · 12 comments
Open

Add way to enable OVERLAP_SIMPLE or OVERLAP_COMPOUND #681

moyogo opened this issue Jul 8, 2020 · 12 comments

Comments

@moyogo
Copy link
Collaborator
moyogo commented Jul 8, 2020

There doesn’t seem to be a way to enable OVERLAP_SIMPLE in ttglyph.flags or OVERLAP_COMPOUND in ttglyph.components[0].flags. These are required for correct handling of overlaps on macOS.

Could --keep-overlaps enable these when generating ttf?

See davelab6/Vollkorn-Typeface#8 (comment)

@moyogo
Copy link
Collaborator Author
moyogo commented Jul 8, 2020

See also fonttools/fonttools#1518

@anthrotype
Copy link
Member

yeah, makes sense that we enable those flags when --keep-overlaps is set. Environments that don't use the flag will simply ignore it. Can you send a PR?

@moyogo
Copy link
Collaborator Author
moyogo commented Jul 9, 2020

Actually, for Vollkorn instances, the overlaps are removed for simple glyphs but the overla 8000 p issue occurs with composite glyphs. So the OVERLAP_COMPOUND bit should be enabled some other way.

@madig
Copy link
Collaborator
madig commented Jul 13, 2020

Hum. I suppose one could check if the bounding boxes of contours or components overlap and set OVERLAP_SIMPLE or OVERLAP_COMPOUND respectively?

@m4rc1e
Copy link
Contributor
m4rc1e commented Mar 25, 2022

Thought I'd just post a similar issue to this thread.

We're getting requests from the Android team to enable bit 6 for VF glyphs which contain overlapping contours, google/fonts#4405.

Here's a previous discussion related to this issue and the implications for setting it may have,
fonttools/fonttools#2059

Since I need to enable this bit for our VF font collection, I plan to write a very primitive solution since my graphics/2d knowledge is weak. I don't want to enable this bit for every glyph since it will hammer FreeType. My plan is to detect which glyphs have overlaps by duplicating a glyph's outlines, removing the overlaps on the duplicates and then diffing the areas. This is probably too computationally expensive to include in fontmake so I'll just write it as a gftools script to begin with.

@madig
Copy link
Collaborator
madig commented Mar 25, 2022

@m4rc1e nope, use the code in google/fonts#4405 (comment) and integrate it into ufo2ft if it's not there already, we use it in production and it completes in no time. I think I barely measured any compilation time increase.

@m4rc1e
Copy link
Contributor
m4rc1e commented Mar 25, 2022

Thanks! Have you measured what impact this will have on FreeType?

@madig
Copy link
Collaborator
madig commented Mar 25, 2022

Nope! But you need it for overlaps anyway so you have to pay the price 😬

@chrissimpkins
Copy link
Member
chrissimpkins commented Mar 25, 2022

Do we have data on the range of % total glyphs with overlapping contours in "typical" VF families? I'm guessing that this falls into the many bucket, and not none, few, most, or all?

@m4rc1e the only reference that I've come across on the FT impact issue is in fonttools/fonttools#2059 (comment) and related to static instance rendering

in FreeType it quadruples the rendering time

@madig
Copy link
Collaborator
madig commented Mar 25, 2022

Do we have data on the range of % total glyphs with overlapping contours in "typical" VF families?

I got two figures here: google/fonts#4405 (comment)

@chrissimpkins
Copy link
Member

Do we have data on the range of % total glyphs with overlapping contours in "typical" VF families?

I got two figures here: google/fonts#4405 (comment)

The answer is few, many, and most. :)

@tphinney
Copy link

In Science Gothic and an unnamed Google internal project I am working on, the answer is on the order of 1% or 2%.

Mind you, it is currently going up, and will be higher in future projects, because I know that a solution to make the rendering perfect is in the works.

I have avoided it in the past, only choosing overlap as a sort of lesser evil. But if it can render correctly, then I will use it more.

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

6 participants
0