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

getTextZoom() on iOS returns 106 with default settings #35

Open
casati opened this issue May 9, 2016 · 2 comments
Open

getTextZoom() on iOS returns 106 with default settings #35

casati opened this issue May 9, 2016 · 2 comments

Comments

@casati
Copy link

casati commented May 9, 2016

Using the default accessibility settings on iOS device, the getTextZoom method (and related, i.e. updateTextZoom) return "106" instead of 100 because the default text size on iOS seems to be 17pt (not 16)

@lobo87
Copy link

lobo87 commented May 12, 2017

any updates on this issue?

@lobo87
Copy link

lobo87 commented Jun 23, 2017

i fixed that by changing the source code of CDVMobileAccessibility.m

#define iOS10Delta (([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0 ) ? 40 : 0 )
-(double) mGetFontScale {
double fontScale = 1;
if (iOS7Delta) {
fontScale = [[UIFont preferredFontForTextStyle:UIFontTextStyleBody] pointSize] / BASE_UI_FONT_TEXT_STYLE_BODY_POINT_SIZE;
}

if(iOS10Delta) {
    fontScale = [[UIFont preferredFontForTextStyle:UIFontTextStyleBody] pointSize] / 17;
}

return fontScale;

}
this is propably not the nicest solution, because im not really sure for what the scaling value in the #define part is for, but i added it anyway

if you are ok with that solution @majornista i will create a pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants