-
Notifications
You must be signed in to change notification settings - Fork 694
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
feat: Font manifest #17118
Draft
Youssef1313
wants to merge
7
commits into
unoplatform:master
Choose a base branch
from
Youssef1313:font-manifest
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat: Font manifest #17118
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
80e37e3
feat: Font manifest
Youssef1313 40b3407
chore: Address review comment
Youssef1313 5366342
chore: Feedback
Youssef1313 2fc34cf
chore: Feedback
Youssef1313 d28d2be
chore: Address review comment
Youssef1313 8c71e1a
chore: Font manifest for Android
Youssef1313 44390ad
chore: Fix skia
Youssef1313 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Binary file added
BIN
+128 KB
src/SamplesApp/UITests.Shared/Assets/Fonts/OpenSans/OpenSans-Regular.ttf
Binary file not shown.
34 changes: 34 additions & 0 deletions
34
src/SamplesApp/UITests.Shared/Assets/Fonts/OpenSans/OpenSans.ttf.manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"fonts": [ | ||
{ | ||
"font_style": "italic", | ||
"font_weight": 400, | ||
"font_stretch": "Condensed", | ||
"family_name": "ms-appx:///Assets/Fonts/OpenSans/OpenSans_Condensed-MediumItalic.ttf" | ||
}, | ||
{ | ||
"font_style": "normal", | ||
"font_weight": 400, | ||
"font_stretch": "SemiCondensed", | ||
"family_name": "ms-appx:///Assets/Fonts/OpenSans/OpenSans_SemiCondensed-Regular.ttf" | ||
}, | ||
{ | ||
"font_style": "normal", | ||
"font_weight": 600, | ||
"font_stretch": "SemiCondensed", | ||
"family_name": "ms-appx:///Assets/Fonts/OpenSans/OpenSans_SemiCondensed-SemiBold.ttf" | ||
}, | ||
{ | ||
"font_style": "normal", | ||
"font_weight": 700, | ||
"font_stretch": "Normal", | ||
"family_name": "ms-appx:///Assets/Fonts/OpenSans/OpenSans-Bold.ttf" | ||
}, | ||
{ | ||
"font_style": "normal", | ||
"font_weight": 400, | ||
"font_stretch": "Normal", | ||
"family_name": "ms-appx:///Assets/Fonts/OpenSans/OpenSans-Regular.ttf" | ||
}, | ||
] | ||
} |
Binary file added
BIN
+133 KB
src/SamplesApp/UITests.Shared/Assets/Fonts/OpenSans/OpenSans_Condensed-MediumItalic.ttf
Binary file not shown.
Binary file added
BIN
+128 KB
src/SamplesApp/UITests.Shared/Assets/Fonts/OpenSans/OpenSans_SemiCondensed-Regular.ttf
Binary file not shown.
Binary file added
BIN
+128 KB
src/SamplesApp/UITests.Shared/Assets/Fonts/OpenSans/OpenSans_SemiCondensed-SemiBold.ttf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -708,6 +708,27 @@ public FontStyle FontStyle | |
); | ||
#endregion | ||
|
||
#region FontStretch | ||
|
||
public FontStretch FontStretch | ||
{ | ||
get => (FontStretch)this.GetValue(FontStretchProperty); | ||
set => this.SetValue(FontStretchProperty, value); | ||
} | ||
|
||
public static DependencyProperty FontStretchProperty { get; } = | ||
DependencyProperty.Register( | ||
nameof(FontStretch), | ||
typeof(FontStretch), | ||
typeof(Control), | ||
new FrameworkPropertyMetadata( | ||
FontStretch.Normal, | ||
FrameworkPropertyMetadataOptions.Inherits, | ||
(s, e) => ((Control)s)?.OnFontStretchChanged((FontStretch)e.OldValue, (FontStretch)e.NewValue) | ||
) | ||
); | ||
Comment on lines
+719
to
+729
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generated properties |
||
#endregion | ||
|
||
#region Padding DependencyProperty | ||
|
||
public Thickness Padding | ||
|
@@ -967,6 +988,13 @@ protected virtual void OnFontStyleChanged(FontStyle oldValue, FontStyle newValue | |
|
||
partial void OnFontStyleChangedPartial(FontStyle oldValue, FontStyle newValue); | ||
|
||
private protected virtual void OnFontStretchChanged(FontStretch oldValue, FontStretch newValue) | ||
{ | ||
OnFontStretchChangedPartial(oldValue, newValue); | ||
} | ||
|
||
partial void OnFontStretchChangedPartial(FontStretch oldValue, FontStretch newValue); | ||
|
||
protected virtual void OnPaddingChanged(Thickness oldValue, Thickness newValue) | ||
{ | ||
OnPaddingChangedPartial(oldValue, newValue); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,6 +185,36 @@ private void OnFontStyleChanged() | |
|
||
#endregion | ||
|
||
#region FontStretch Dependency Property | ||
|
||
public FontStretch FontStretch | ||
{ | ||
get => (FontStretch)GetValue(FontStretchProperty); | ||
set => SetValue(FontStretchProperty, value); | ||
} | ||
|
||
public static DependencyProperty FontStretchProperty { get; } = | ||
DependencyProperty.Register( | ||
nameof(FontStretch), | ||
typeof(FontStretch), | ||
typeof(TextBlock), | ||
new FrameworkPropertyMetadata( | ||
defaultValue: FontStretch.Normal, | ||
options: FrameworkPropertyMetadataOptions.Inherits, | ||
propertyChangedCallback: (s, e) => ((TextBlock)s).OnFontStretchChanged() | ||
) | ||
); | ||
Comment on lines
+196
to
+206
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generated properties |
||
|
||
private void OnFontStretchChanged() | ||
{ | ||
OnFontStretchChangedPartial(); | ||
InvalidateTextBlock(); | ||
} | ||
|
||
partial void OnFontStretchChangedPartial(); | ||
|
||
#endregion | ||
|
||
#region TextWrapping Dependency Property | ||
|
||
public TextWrapping TextWrapping | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use generated properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeromelaban For readability or perf?
My concern with generated DPs is that they cache the value when it changes. So, it's faster, but increases the object size. So my personal view to it is "speed vs memory"