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

Coordinate ptem with variable opsz #1914

Open
ebraminio opened this issue Aug 20, 2019 · 11 comments
Open

Coordinate ptem with variable opsz #1914

ebraminio opened this issue Aug 20, 2019 · 11 comments

Comments

@ebraminio
Copy link
Collaborator

ebraminio commented Aug 20, 2019

Great that we now have #1484 as it will ease this, one thing I think worth to do eventually is to coordinate _set_ptem with opsz variation axis (and maybe deprecate _set_ptem eventually), I am not sure how that should be done, maybe simulating an axis variation when trak table exists? Setting the axis when _set_ptem is called? etc. Let me know what do you think

@behdad
Copy link
Member

behdad commented Aug 20, 2019

I agree we want some of those things. Not sure about specifics. Let this sit here for a while. :) I thought I opened an issue for it before.

@drott
Copy link
Collaborator

drott commented Oct 17, 2019

I am concerned about the case that in Blink it would be possible to override opsz using font-variation-settings and disconnect it from ptem-size - in that case I prefer it not to be automatic behind the scenes.

@behdad
Copy link
Member

behdad commented Oct 17, 2019

So I think trak and opsz should be controlled the same way. Same way that we control TT kern table using kern OT feature.

How to control it, what takes priority over what, to be determined, and is entangled in other things, like named-instances and desire that their variations stick. Ie. #1883

So, we're moving to a place that a font's variations don't start to default coordinates, but they come from the named-instance, then overriden by set_pptm and only then overriden by explicitly-specified varitations.

@behdad
Copy link
Member

behdad commented Oct 17, 2019

So Blink can always override.

@matthiasclasen
Copy link
Collaborator

This would be great to have. I'm looking at what to do for opsz in pango, and having harfbuzz just do the right thing would be by far the easiest.

@behdad
Copy link
Member

behdad commented Nov 8, 2021

This would be great to have. I'm looking at what to do for opsz in pango, and having harfbuzz just do the right thing would be by far the easiest.

I agree. As a first step let's make pango call hb_font_set_ptem if it doesn't.

@behdad
Copy link
Member

behdad commented Nov 8, 2021

@behdad
Copy link
Member

behdad commented Nov 10, 2021

Thinking more about this I think I want to deprecate this API and make it simply return the currently-set value of the opsz axis. Adding two new API:

  void hb_font_set_variation(font, hb_tag_t, float value);
  float hb_font_get_variation(font, hb_tag_t);

these set/get one variation without disturbing others.

The reasoning is that if we were to keep the ptem API, then we'd also need to add API for weight and width, and other standard axes when they are added. But by precedent we prefer enum-based APIs like our hb-style, hb-ot-metrics, etc. That API style also obviates the interaction questions raised.

@behdad
Copy link
Member

behdad commented Nov 11, 2021

Thinking more about this I think I want to deprecate this API and make it simply return the currently-set value of the opsz axis. Adding two new API:

  void hb_font_set_variation(font, hb_tag_t, float value);
  float hb_font_get_variation(font, hb_tag_t);

these set/get one variation without disturbing others.

The reasoning is that if we were to keep the ptem API, then we'd also need to add API for weight and width, and other standard axes when they are added. But by precedent we prefer enum-based APIs like our hb-style, hb-ot-metrics, etc. That API style also obviates the interaction questions raised.

@jfkthame does this make sense to you?

@behdad
Copy link
Member

behdad commented Feb 12, 2022

Thinking more about this I think I want to deprecate this API and make it simply return the currently-set value of the opsz axis. Adding two new API:

  void hb_font_set_variation(font, hb_tag_t, float value);
  float hb_font_get_variation(font, hb_tag_t);

these set/get one variation without disturbing others.

One issue with this is that, in the future (FontVars2.0) avar calculations would need to be run for the full font after each variation is changed, so this style of API is more likely to encourage an O(n^2) style of setting variations.

@jfkthame still would value your input.

@behdad
Copy link
Member

behdad commented Sep 8, 2022

Seems like this is the root of a few bugs:

#1914
https://gitlab.gnome.org/GNOME/pango/-/issues/695

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

4 participants