TALButton does not display Anymore when setting the font Size
Hi,
I am trying to implement accessibility support in my apps to respect the system text settings. This is just some off-topic information: I use this code to get the multiplier:
function GetFontScale: Single;
{$IF DEFINED(ANDROID)}
function GetFontSizeMultiplier: Single;
var
Configuration: JConfiguration;
begin
Configuration := TAndroidHelper.Context.getResources.getConfiguration;
Result := Configuration.fontScale;
end;
{$ELSEIF DEFINED(IOS)}
function GetFontSizeMultiplier: Single;
var
App: UIApplication;
Category: NSString;
begin
App := TUIApplication.Wrap(TUIApplication.OCClass.sharedApplication);
Category := App.preferredContentSizeCategory;
if Category.isEqualToString(UIContentSizeCategoryExtraSmall) then
Exit(0.8);
if Category.isEqualToString(UIContentSizeCategorySmall) then
Exit(0.9);
if Category.isEqualToString(UIContentSizeCategoryMedium) then
Exit(0.95);
if Category.isEqualToString(UIContentSizeCategoryLarge) then
Exit(1.0);
if Category.isEqualToString(UIContentSizeCategoryExtraLarge) then
Exit(1.1);
if Category.isEqualToString(UIContentSizeCategoryExtraExtraLarge) then
Exit(1.2);
if Category.isEqualToString(UIContentSizeCategoryExtraExtraExtraLarge) then
Exit(1.3);
if (Category.rangeOfString(StrToNSStr('Accessibility')).location <> NSNotFound) then
Exit(1.5);
Result := 1.0;
end;
{$ELSE}
function GetFontSizeMultiplier: Single;
begin
Result := 1.0;
end;
{$ENDIF}
begin
Result := GetFontSizeMultiplier;
end;
When I change the size of the text settings inside a button or other components, they disappear. Here is a sample to reproduce the problem.
@ETSPMeder I just try your demo, it's because you didn't activate the Skia on windows. Skia is mandatory on windows (but optional on ios/android). This is because on android/ios we use the OS graphic engine and on windows we use the skia graphic engine
Do you mean Adding this to the project.dpr?
GlobalUseSkia := True;
I Added this, but it does not change anything or do I need to change other things?
not really, i mean this:
this will add the GlobalUseSkia := True to the project option and will also add the SKIA define to the project