Default UIFont size and weight but also support preferredFontForTextStyle
up vote
2
down vote
favorite
If I have my own group of UIFont
s with different sizes and weights, for example:
let customFont03 = UIFont.systemFont(ofSize: 40, weight: .thin)
How can I support Dynamic Type
while still preserving my custom size and weight as a default standard and scaling that depending on how the user selects accessibility sizes?
I'm not sure that preferredFont(forTextStyle:)
is what I want because it only accepts a UIFont.TextStyle
and I don't want to lock customFont03
in as a .body
or .headline
etc...
ios swift accessibility
add a comment |
up vote
2
down vote
favorite
If I have my own group of UIFont
s with different sizes and weights, for example:
let customFont03 = UIFont.systemFont(ofSize: 40, weight: .thin)
How can I support Dynamic Type
while still preserving my custom size and weight as a default standard and scaling that depending on how the user selects accessibility sizes?
I'm not sure that preferredFont(forTextStyle:)
is what I want because it only accepts a UIFont.TextStyle
and I don't want to lock customFont03
in as a .body
or .headline
etc...
ios swift accessibility
What traits do you want to keep from the preferredFont and what traits do you want to override with your own setup?
– rmaddy
Nov 17 at 23:27
I want size40
and weightthin
to be the default, but if the user changes the settings to anything other than the default the weight and size will scale appropriately.
– Turnipdabeets
Nov 17 at 23:29
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
If I have my own group of UIFont
s with different sizes and weights, for example:
let customFont03 = UIFont.systemFont(ofSize: 40, weight: .thin)
How can I support Dynamic Type
while still preserving my custom size and weight as a default standard and scaling that depending on how the user selects accessibility sizes?
I'm not sure that preferredFont(forTextStyle:)
is what I want because it only accepts a UIFont.TextStyle
and I don't want to lock customFont03
in as a .body
or .headline
etc...
ios swift accessibility
If I have my own group of UIFont
s with different sizes and weights, for example:
let customFont03 = UIFont.systemFont(ofSize: 40, weight: .thin)
How can I support Dynamic Type
while still preserving my custom size and weight as a default standard and scaling that depending on how the user selects accessibility sizes?
I'm not sure that preferredFont(forTextStyle:)
is what I want because it only accepts a UIFont.TextStyle
and I don't want to lock customFont03
in as a .body
or .headline
etc...
ios swift accessibility
ios swift accessibility
asked Nov 17 at 23:25
Turnipdabeets
1,73021229
1,73021229
What traits do you want to keep from the preferredFont and what traits do you want to override with your own setup?
– rmaddy
Nov 17 at 23:27
I want size40
and weightthin
to be the default, but if the user changes the settings to anything other than the default the weight and size will scale appropriately.
– Turnipdabeets
Nov 17 at 23:29
add a comment |
What traits do you want to keep from the preferredFont and what traits do you want to override with your own setup?
– rmaddy
Nov 17 at 23:27
I want size40
and weightthin
to be the default, but if the user changes the settings to anything other than the default the weight and size will scale appropriately.
– Turnipdabeets
Nov 17 at 23:29
What traits do you want to keep from the preferredFont and what traits do you want to override with your own setup?
– rmaddy
Nov 17 at 23:27
What traits do you want to keep from the preferredFont and what traits do you want to override with your own setup?
– rmaddy
Nov 17 at 23:27
I want size
40
and weight thin
to be the default, but if the user changes the settings to anything other than the default the weight and size will scale appropriately.– Turnipdabeets
Nov 17 at 23:29
I want size
40
and weight thin
to be the default, but if the user changes the settings to anything other than the default the weight and size will scale appropriately.– Turnipdabeets
Nov 17 at 23:29
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
The default standard text style is .body
so, if you want to preserve your custom size as the default standard while supporting the Dynamic Type
, you should define and adapt the keys fontName
and fontSize
to your custom size in a style dictionary.
Using the Dynamic Type
means using the text styles. If you want specific font, you must define it in a native text style so that it's perfectly and automatically handled by the system.
I suggest you take a look at this great "useYourLoaf" article and at this useful accessibility site.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The default standard text style is .body
so, if you want to preserve your custom size as the default standard while supporting the Dynamic Type
, you should define and adapt the keys fontName
and fontSize
to your custom size in a style dictionary.
Using the Dynamic Type
means using the text styles. If you want specific font, you must define it in a native text style so that it's perfectly and automatically handled by the system.
I suggest you take a look at this great "useYourLoaf" article and at this useful accessibility site.
add a comment |
up vote
0
down vote
The default standard text style is .body
so, if you want to preserve your custom size as the default standard while supporting the Dynamic Type
, you should define and adapt the keys fontName
and fontSize
to your custom size in a style dictionary.
Using the Dynamic Type
means using the text styles. If you want specific font, you must define it in a native text style so that it's perfectly and automatically handled by the system.
I suggest you take a look at this great "useYourLoaf" article and at this useful accessibility site.
add a comment |
up vote
0
down vote
up vote
0
down vote
The default standard text style is .body
so, if you want to preserve your custom size as the default standard while supporting the Dynamic Type
, you should define and adapt the keys fontName
and fontSize
to your custom size in a style dictionary.
Using the Dynamic Type
means using the text styles. If you want specific font, you must define it in a native text style so that it's perfectly and automatically handled by the system.
I suggest you take a look at this great "useYourLoaf" article and at this useful accessibility site.
The default standard text style is .body
so, if you want to preserve your custom size as the default standard while supporting the Dynamic Type
, you should define and adapt the keys fontName
and fontSize
to your custom size in a style dictionary.
Using the Dynamic Type
means using the text styles. If you want specific font, you must define it in a native text style so that it's perfectly and automatically handled by the system.
I suggest you take a look at this great "useYourLoaf" article and at this useful accessibility site.
edited 18 hours ago
answered yesterday
XLE_22
28437
28437
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53356530%2fdefault-uifont-size-and-weight-but-also-support-preferredfontfortextstyle%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What traits do you want to keep from the preferredFont and what traits do you want to override with your own setup?
– rmaddy
Nov 17 at 23:27
I want size
40
and weightthin
to be the default, but if the user changes the settings to anything other than the default the weight and size will scale appropriately.– Turnipdabeets
Nov 17 at 23:29