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

[.NET] FontStyle Implementation #1988

Merged
merged 18 commits into from
Oct 26, 2018
Merged

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented Oct 3, 2018

Implementation for #1078 on .NET platform (#1967)

HostConfig now has the following FontStylesConfig: Default, Display, Monospace.
Each FontStyleConfig has a FontFamilyConfig, a FontWeightConfig, and a FontSizeConfig.
The top-level FontFamily, FontSizes and FontWeights is now deprecated.

Testing

Created TextBlock.FontStyles.json to test different text blocks using different styles. On my own tested weight and sizes and they work too (can't tell the difference between weight of 200 and 400 but dev mode on Edge says they are set differently).

Also created 2 new host configs:

  • sampleFontStyles.json: all font styles defined
  • sampleMissingFontStyles.json: only Default is defined

I used sample.json and sampleDifferentText.json to test inheritance from deprecated properties.

Notes

  • Config: GetFontWeight() and GetFontSize() are fast ways of returning the desired property.
  • Config: GetDefaultFontWeight() and GetDefaultFontSize() return the constant default (not fontStyle Default).
  • Renderer: GetFontWeight(), GetFontSize(), and GetFontFamily() look a little weird but way cleaner than expanding it out. Let me know your thoughts on how to make it more legible though.

@carlos-zamora carlos-zamora added Platform-.NET Platform-JavaScript Bugs or features related to the JavaScript renderer labels Oct 3, 2018
@paulcam206
Copy link
Member

paulcam206 commented Oct 3, 2018

inconsistent spacing here #Closed


Refers to: samples/Tests/TextBlock.MultipleFonts.json:27 in 7e3bdb6. [](commit_id = 7e3bdb6, deletion_comment = False)

@carlos-zamora carlos-zamora self-assigned this Oct 12, 2018
@carlos-zamora carlos-zamora mentioned this pull request Oct 17, 2018
Copy link
Member

@paulcam206 paulcam206 left a comment

Choose a reason for hiding this comment

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

🕐

…font family from Default style and deprecated value. Goes directly to special constant.
Copy link
Member

@paulcam206 paulcam206 left a comment

Choose a reason for hiding this comment

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

:shipit:

@carlos-zamora carlos-zamora merged commit 2dfae1f into master Oct 26, 2018
@carlos-zamora carlos-zamora deleted the cazamor/1967-multiplefonts-.net branch October 26, 2018 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform-.NET Platform-JavaScript Bugs or features related to the JavaScript renderer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants