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

[Draft] Add font objects #4093

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

bluebear94
Copy link
Contributor

See #3488 and #3331.

  • Add font type (implicitly convertible from string)
  • Add per-font OpenType features – will be a lot more complicated because text::features assumes that text will use the same OpenType features regardless of which font is selected.
  • Add per-font Unicode ranges

Unresolved questions:

  • Should we deprecate OpenType feature-related options on text?

@Enivex
Copy link
Collaborator

Enivex commented May 7, 2024

Should we deprecate OpenType feature-related options on text?

In my opinion yes. These features are fundamentally tied to each specific font.

@bluebear94
Copy link
Contributor Author

In my opinion yes. These features are fundamentally tied to each specific font.

Would that only apply to alternates, stylistic_set, and features, or others like kerning, ligatures, and number_type?

@Enivex
Copy link
Collaborator

Enivex commented May 7, 2024

In my opinion yes. These features are fundamentally tied to each specific font.

Would that only apply to alternates, stylistic_set, and features, or others like kerning, ligatures, and number_type?

All of them. But Laurenz may have a different opinion.

@PgBiel
Copy link
Contributor

PgBiel commented May 8, 2024

I have a feeling that it'd still be nice to be able to configure those independently of the font (while also offering the possibility of having per-font configuration).

@Myriad-Dreamin
Copy link
Contributor

I have a feeling that it'd still be nice to be able to configure those independently of the font (while also offering the possibility of having per-font configuration).

"But Laurenz may have a different opinion."
That is: The font-specific features should be move from field of text element to that of font object, but not necessary for those are not font-specific. For example, it is possible not meaningful to share stylistic_set, but can be meaningful to share ligatures.

@PgBiel
Copy link
Contributor

PgBiel commented May 8, 2024

"But Laurenz may have a different opinion."

Yeah! Just wanted to share mine too :)

That is: The font-specific features should be move from field of text element to that of font object, but not necessary for those are not font-specific. For example, it is possible not meaningful to share stylistic_set, but can be meaningful to share ligatures.

Sure, but how could we implement those shared properties other than through the current design?
I guess we could make font() foldable in order to have some default-font property usable within set rules, or something. Not sure though - I feel a bit uneasy about the proposed design (I wonder if this is sufficiently appealing to new users).

@bluebear94
Copy link
Contributor Author

Right now, I have font-specific features always take precedence over features set in text. I think it would be better to have whatever setting is innermost take precedence, but I’m not sure how this would be done.

@laurmaedje
Copy link
Member

I left a few comments in the Fonts forge on Discord.

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.

None yet

5 participants