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

text/v2: improve the performance of Advance with a GoTextFace #2963

Open
11 tasks
hajimehoshi opened this issue Apr 17, 2024 · 4 comments
Open
11 tasks

text/v2: improve the performance of Advance with a GoTextFace #2963

hajimehoshi opened this issue Apr 17, 2024 · 4 comments
Milestone

Comments

@hajimehoshi
Copy link
Owner

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

What feature would you like to be added?

When a GoTextFace is used for Advance, glyphs shapes are created. This might be redundant when you want to know just an advanve value. Let's optimize the implementation of Advance to improve the performance.

Why is this needed?

Improve Advance performance makes us happy

@hajimehoshi hajimehoshi added this to the v2.8.0 milestone Apr 17, 2024
@hajimehoshi
Copy link
Owner Author

Hmm, is it possible to know an advance value without calculating shapes?

hajimehoshi added a commit that referenced this issue Apr 17, 2024
@benoitkugler
Copy link

An idea you might want to consider is to split the current GoTextFaceSource.shape into two functions : one which only performs the layout, computing a shaping.Line; the other one which takes such a line and draws it. Now, with this setup, advance would only call the first function and avoid loading the glyph segments.

@hajimehoshi
Copy link
Owner Author

Unfortunately go-text HarfBuzzShaper.Shape function doesn't split the functions (calculating glyphs and calculating layouts), and this is the problem.

@benoitkugler
Copy link

Unfortunately go-text HarfBuzzShaper.Shape function doesn't split the functions (calculating glyphs and calculating layouts), and this is the problem.

I might have misunderstood the issue : I thought you wanted to avoid creating glyph shapes, that is calling Face.GlyphData.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants