-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix(Watermark): Chinese characters cannot be displayed (#2157)
* 🐛 fix(Watermark): Chinese characters cannot be displayed * update docs
- Loading branch information
Showing
5 changed files
with
60 additions
and
9 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
docs/Masa.Blazor.Docs/Examples/labs/watermark/Chinese.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@using SkiaSharp | ||
|
||
<MWatermark Text="雅黑" Typeface="@_typeface"> | ||
<div style="height: 300px;"></div> | ||
</MWatermark> | ||
|
||
@code { | ||
|
||
private SKTypeface? _typeface = SKTypeface.FromFamilyName("Microsoft YaHei"); | ||
|
||
// protected override void OnAfterRender(bool firstRender) | ||
// { | ||
// if (firstRender) | ||
// { | ||
// _typeface = SKTypeface.FromFile(GetFontPath()); | ||
// StateHasChanged(); | ||
// } | ||
// } | ||
// private static string GetFontPath() | ||
// { | ||
// // Server side | ||
// var dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); | ||
// return Path.Combine(dir, "wwwroot", "ABC.ttf"); | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters