fix(ios): support for a11y font scale (#10207)

This commit is contained in:
Dimitris-Rafail Katsampas
2023-03-23 00:13:46 +02:00
committed by GitHub
parent ab436dbfe6
commit 95f3772e77
6 changed files with 50 additions and 33 deletions

View File

@@ -0,0 +1,17 @@
import * as TKUnit from '../../tk-unit';
import * as helper from '../../ui-helper';
import { Label } from '@nativescript/core';
export function test_native_font_size_with_a11y_font_scale() {
const page = helper.getCurrentPage();
const testView = new Label();
const deviceFontScaleMock = 4.0;
page.content = testView;
testView.style._fontScale = deviceFontScaleMock;
const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
const expectedNativeFontSize = testView.style.fontInternal.fontSize * deviceFontScaleMock;
TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size does not respect a11y font scaling');
}