LoginSignup
0
0

More than 1 year has passed since last update.

ビルドアクション MauiFontで埋め込んだttf・otfファイルをStreamとして読み込む

Last updated at Posted at 2022-09-02

ビルドアクションMauiAssetsやResources/Rawについてしか細かい記載がないが、ビルドアクションがMauiFontでも読めるっぽい。
アプリ パッケージにバンドルされているファイルを開くには、とあって、どのビルドアクションまで対応してるのか詳細まではいまいち・・・。

スクリーンショット 2022-09-02 145138.png

// FileSystem: Microsoft.Maui.Storage.FileSystem
// Stream: System.IO.Stream
Stream stream = FileSystem.Current.OpenAppPackageFileAsync("NotoSansJP-Regular.otf").Result;

  
 
 
 
 

SkiaSharpのSKTypefaceの生成に埋め込んだフォントを使いたかった。

var typeface = SkiaSharp.SKTypeface.FromStream(stream);
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0