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

[Complex Text Layouts] Add variable fonts support. #43030

Merged
merged 1 commit into from
Dec 13, 2020

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Oct 23, 2020

Implements godotengine/godot-proposals#1704

var_props

output

All features (variable font and OpenType) are available for the Godot code editor font:
output

Demo project: VarFonts.zip

@vesk4000
Copy link

I'm sorry, I'm not the very knowledgeable about the code base, but am I the only one who thinks it's kinda crazy how this adds almost 400 000 lines of code? Like, I simply don't get it... How even is this possible, I'm not trying to be rude or whatever, but I'm honestly just confused.

@bruvzg
Copy link
Member Author

bruvzg commented Oct 24, 2020

I'm sorry, I'm not the very knowledgeable about the code base, but am I the only one who thinks it's kinda crazy how this adds almost 400 000 lines of code? Like, I simply don't get it... How even is this possible, I'm not trying to be rude or whatever, but I'm honestly just confused.

It is done on top of #41100 which adds ICU, HarfBuzz and SIL Graphite third party libraries (+361015, -4), TextServer implementation to use these libraries, fully rewritten Fonts and tons of changes to the controls to support new text rendering and BiDI UI.

Actual variable font support is only the last commit, 342 insertions(+), 8 deletions(-).

@vesk4000
Copy link

I'm sorry, I'm not the very knowledgeable about the code base, but am I the only one who thinks it's kinda crazy how this adds almost 400 000 lines of code? Like, I simply don't get it... How even is this possible, I'm not trying to be rude or whatever, but I'm honestly just confused.

It is done on top of #41100 which adds ICU, HarfBuzz and SIL Graphite third party libraries (+361015, -4), TextServer implementation to use these libraries, fully rewritten Fonts and tons of changes to the controls to support new text rendering and BiDI UI.

Actual variable font support is only the last commit, 342 insertions(+), 8 deletions(-).

Oh I guess that makes sense, this seems like a good PR.

@bruvzg bruvzg force-pushed the ctl_var_font branch 5 times, most recently from 7f7016f to 75cab51 Compare October 28, 2020 10:45
@bruvzg bruvzg changed the title [WIP] Add variable fonts support [Complex Text Layouts] Add variable fonts support. Oct 28, 2020
@bruvzg bruvzg force-pushed the ctl_var_font branch 6 times, most recently from 95b16fc to 523c209 Compare November 2, 2020 09:29
@bruvzg bruvzg marked this pull request as ready for review November 2, 2020 11:20
@bruvzg bruvzg requested review from akien-mga, neikeq and a team as code owners November 2, 2020 11:20
@bruvzg bruvzg force-pushed the ctl_var_font branch 4 times, most recently from c522da8 to 21210fd Compare November 3, 2020 21:39
<return type="Dictionary">
</return>
<description>
Returns [code]";"[/code] separated list of supported variation coordinates, each coordinate is returned in the following format: [code]"tag,min_value,max_value,default_value"[/code].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to add some details on what variation coordinates are / which kind of fonts support them and for what purpose (e.g. with a link to an appropriate reference).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added description and link to OpenType registry.

<method name="font_get_variation_list" qualifiers="const">
<return type="Dictionary">
</return>
<argument index="0" name="fonte" type="RID">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "fonte" a typo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

<argument index="0" name="fonte" type="RID">
</argument>
<description>
Returns list of supported variation coordinates, each coordinate is returned as [code]Vector3i(min_value,max_value,default_value)[/code].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also have more details as commented in FontData. Is the different return format intended?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format is the same tag: Vector3i(min, max, def).

@akien-mga akien-mga merged commit 06314c1 into godotengine:master Dec 13, 2020
@akien-mga
Copy link
Member

Thanks!

@bruvzg bruvzg deleted the ctl_var_font branch December 13, 2020 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants