Hi @mc ,
Sorry to bother you - and I’m really glad to hear you managed to identify the cause of the issue!
Just to add some technical background for anyone else who may hit the same behavior:
According to Microsoft’s official documentation for file-system helpers, any file added with the MauiAsset build action can normally be opened using FileSystem.OpenAppPackageFileAsync, and .NET MAUI processes all files under Resources/Raw as MauiAsset:
However, Microsoft also documents that font files (such as .ttf and .otf) are intended to be placed under Resources/Fonts and use the MauiFont build action instead of MauiAsset:
https://learn.microsoft.com/dotnet/maui/user-interface/fonts?view=net-maui-10.0
Because of that difference, when a TrueType font is included as a MauiAsset on iOS, the system may not allow it to be treated as a raw data stream at runtime. This explains why your .txt file worked correctly, but the .ttf file did not - and why renaming the font (for example, from font1.ttf → font1.db) allows iOS to treat it like a normal asset rather than a font resource.
This means the behavior you observed is consistent with how iOS and MAUI handle fonts vs. generic assets, even though Microsoft does not explicitly document a limitation about opening .ttf files with OpenAppPackageFileAsync on iOS. Your rename solution is therefore a valid workaround when you need to read the raw bytes of a font file instead of registering it as a UI font.
Thanks again for sharing your findings - this will definitely help others who attempt to read font files as raw assets on iOS using FileSystem.OpenAppPackageFileAsync.