Xamarin Forms accessibility features font size - xamarin

If I have a label, how do I get it to adjust to larger font sizes as expressed by a user's accessibility settings? I have scoured the Internet and can't find any articles related to this issue.
<Label FontSize="14" />

use Named Font Sizes
Body
Caption
Default
Header
Large
Medium
Micro
Small
Subtitle
Title
On iOS and Android, named font sizes will autoscale based on operating
system accessibility options.

Related

Changing the size of fonts for dpi

Almost every source about Win32 dpi says that you need to load new scaled fonts.
I tested a simple application (main window and a child ListView, written in pure WinAPI) on WinXpSP3, Win7 and Win10 and in all cases the OS always automatically set the correct font size (and even non-client areas) both at startup and when changing the system scaling in runtime. The only thing I had to change manually was the size of the windows themselves and the size of the icons in the ListView.
The application manifest contained
dpiAware True/PM
dpiAwareness PerMonitorV2, PerMonitor
And I'm a little confused. It turns out that manual processing of fonts is needed only for owner-drawn controls?

Xamarin form 4.3 Label using sans-serif front

I am building a Android and iOS app and wanted to use sans-serif front on a label but I dont see it on the http://iosfonts.com/. I see the front on https://fonts.google.com/?query=sans+serif but I am not sure what to use in the FontFamily tag?
<Label Grid.Row="1" Text="TestFrontFamily" LineBreakMode="WordWrap" FontSize="20" HorizontalOptions="Center" VerticalOptions="End" TextColor="White" FontFamily="sans-serif"></Label>
As a general rule, you should never change the font in your app. Use the system default font. This is what people are used to on their phone, and opening an app that uses a different font is jarring.
With that out of the way, you need to download the font file, either otf or ttf, and save it somewhere in each android and iOS project. Then the font family points at that file. For example:
Font file placed in Fonts folder:
iOS: FontAwesome5ProLight
Android: Fonts/fa5-pro-light-300.otf#FontAwesome5ProLight
For iOS you simply need the font family name to be the name of the font to use. For Android, you need to include the path relative to the android csproj file as well as the font file name followed by # and the font name.
See Xamarin Font Documentation for further information.

Outlook font size for add in

I need help with the text size for my outlook add in.
I have a table view in my add in which is unreadable with bigger screen resolutions. Is there a way to zoom so the font size gets bigger?
With a selected email from my inbox it is possible to zoom with the zoom slider in the bottom right corner. Is there a way to activate the zoom slider at any time? Or is there any way to access and change/set the font size outside of the email body?
It looks like your add-in is not DPI-aware. Desktop applications using older Windows programming technologies (raw Win32 programming, Windows Forms, Windows Presentation Framework (WPF), etc.) are unable to automatically handle DPI scaling without additional developer work. Without such work, applications will appear blurry or incorrectly-sized in many common usage scenarios. To make things working better you must read the following articles:
High DPI Desktop Application Development on Windows
Writing DPI-Aware Desktop and Win32 Applications
Most probably the table view is used on a windows form, see Automatic scaling in Windows Forms for more information.

Adjusting the font size in Xcode's Developer Documentation window?

The small font size in dark mode makes it difficult to read. Is there a way to increase the size?
You can't change the Developer Documentation Window specifically.
You can take advantage of using a nice feature under Zoom accessibility options in system preferences. It has a feature that let you set the font of anything you mouseover while holding a key:
(Screenshot from macOS 10.15)

Automatic Dark/Light Icon Support in Windows Phone 8

I think this is a very common problem, but I cannot find a suitable solution for me. As you all know, WP supports a dark and a light theme. The user can change the theme and there are ways to override his decision and to display everything in the color theme you've selected. However, I'm just trying to react to this two theme types and I want to display icons in the correct color.
If you use the Application Bar, you can select from many built in icons, which will be automatically inverted from light to dark and vice versa.
Why isn't there any support for normal images? For example: I want to display a telephone icon. I've picked one from the built in icons and copied it from the Microsoft SDK folder to the Image folder of my project. If the user uses the dark theme, everything will be fine because the white telephone icon will be visible on the black background. But if he switches to the light theme, the icon will be invisible because it is white on white.
I'm fully aware of the style resources for textboxes or background colors, which use the phone's accent or theme color. But why is it, that there is no support for simple icons which I added as Image to my XAML page?
Of course I could detect in the constructor of the page if the user is in dark or light mode. I would then load either a black or white version of the telephone icon. But this check will be done everytime I visit the page and slows everything down. It's also annoying to manually add the check for the theme each time I'm adding a theme aware image.
Is there any solution, which will work with XAML only? Or is at least easy to maintain? And why can't I use the built in images from the SDK right from the beginning? They are already available in dark and light versions and are already used in the application bar.
If you want the icon to function like in the actionbar, just be white (if dark theme) and black (if light theme) then you can add the image as an opacity mask to a rectangle, like this:
<Rectangle Fill="{StaticResource PhoneForegroundBrush}" Width="48" Height="48" >
<Rectangle.OpacityMask>
<ImageBrush ImageSource="/Images/my.icon.png" />
</Rectangle.OpacityMask>
</Rectangle>
Where my.icon.png is a white image, like those you can choose for the actionbar.
You could use vector graphics instead of bitmap icons and use a theme-aware brush to draw them.
If you want the App to respond to a switch of the theme you'll need to respond to it any way.
I added a property to the base class of my Views that returns the selected theme. That way I can use/bind to that value.
It is also possible to use a ValueConverter that turns a logical name of a resource into a name of a theme specific resource.
Edit
Have a look at this: Custom light/dark theme resources on Windows Phone 7
Detect the theme (Supporting dark and light themes gives the best solution for this, I think), and then set the image accordingly. If you do this a lot, a custom control where you can supply two image sources and the correct one gets used would be easy enough to create.
Edit: Here's another good article on this topic. New Screen Resolutions
You pick a White Foregrounded icon use it. It suits for both Light and Dark themes. Thats what I have been doing.
The Coding 4 Fun control toolkit includes a round button that mimics the application bar buttons, including updating the foreground color depending on the theme. The code is open source, so perhaps you might find an answer in there. Or, as a hack, you could use the RoundButton control, turn off the border, and not provide a Click event.

Resources