Skip to content

Fix issue where glyphs were renderered as outlines - #35

Open
adamnemecek wants to merge 1 commit into
linebender:masterfrom
adamnemecek:master
Open

Fix issue where glyphs were renderered as outlines#35
adamnemecek wants to merge 1 commit into
linebender:masterfrom
adamnemecek:master

Conversation

@adamnemecek

@adamnemecek adamnemecek commented Jul 17, 2020

Copy link
Copy Markdown

Closes #18

I came across this while trying out the canvas_nanovg example in pathfinder.

The glyphs were rendered like this

skribo

This is the result after this patch:

skribo fix

Credit goes to @jeroentervoorde and @Stoeoef, who figured this out.

Links:
servo/pathfinder#194
fschutt/azul#125 (comment)

@raphlinus

Copy link
Copy Markdown
Contributor

I'm confused, the linked HB doc suggests that the funcs are already set by default. Looking at the HB source, it seems like they are, unless HB_NO_OT_FONT is set. Do we think the Rust HB build is setting that symbol?

@RazrFalcon

RazrFalcon commented Jul 17, 2020

Copy link
Copy Markdown

@raphlinus Unless they are using harfbuzz < 2.0. For example, Ubuntu 18.04 uses 1.7.2.

@adamnemecek

Copy link
Copy Markdown
Author

The rust harfbuzz bindings use 2.6.4.

@raphlinus

Copy link
Copy Markdown
Contributor

Thanks @RazrFalcon, that really helps clear up my confusion. If I understand it, the crate is designed to dynamically link the system HarfBuzz when available, but statically build when not? That would explain diversity of behavior. It's also potentially a very serious problem if we want to depend on newer behavior.

In any case, do you think this is a good fix?

@RazrFalcon

Copy link
Copy Markdown

@adamnemecek It uses system one on linux. You have to set HARFBUZZ_SYS_NO_PKG_CONFIG=1 to opt it.

@RazrFalcon

Copy link
Copy Markdown

@raphlinus Personally, I think using HARFBUZZ_SYS_NO_PKG_CONFIG=1 to always use the embedded version is preferred. I've already had strange bugs in resvg because of relying on a system version.

@raphlinus

Copy link
Copy Markdown
Contributor

Right, I agree. There's just way too much that can go wrong. Adam, would you be willing to make that PR?

@adamnemecek

adamnemecek commented Jul 17, 2020 via email

Copy link
Copy Markdown
Author

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.

layout_run function does not work correctly on ubuntu 18.04

3 participants