Skip to content

Commit

Permalink
Merge pull request #299 from yuzh0816/docs
Browse files Browse the repository at this point in the history
Modify some docs
  • Loading branch information
kikipoulet authored Oct 8, 2024
2 parents 02f2a32 + 9e0dc42 commit f116cc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions docs/docs/documentation/faq/custom-font.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to use Custom Font

Here is the `App.axaml` after creating the SukiUI project:
Here is the `App.axaml` after creating your SukiUI project:

```xml
<Application xmlns="https://github.com/avaloniaui"
Expand All @@ -21,7 +21,7 @@ Here is the `App.axaml` after creating the SukiUI project:
</Application>
```

Assuming that there exists a font file `Assets/MiSans-Bold.ttf` and set the build action of that to `AvaloniaResource`
Assuming that there exists a font file `Assets/FontName-xxx.ttf` and set the build action of that to `AvaloniaResource`

Then replace the `DefaultFontFamily` with your font:

Expand All @@ -37,7 +37,7 @@ Then replace the `DefaultFontFamily` with your font:

<Application.Resources> // [!code highlight]
<ResourceDictionary> // [!code highlight]
<FontFamily x:Key="DefaultFontFamily">avares://SukiTest/Assets/MiSans-Bold.ttf#MiSans</FontFamily> // [!code highlight]
<FontFamily x:Key="DefaultFontFamily">avares://YourProject/Assets#FontName</FontFamily> // [!code highlight]
</ResourceDictionary> // [!code highlight]
</Application.Resources> // [!code highlight]

Expand All @@ -49,8 +49,4 @@ Then replace the `DefaultFontFamily` with your font:
<sukiUi:SukiTheme ThemeColor="Blue" />
</Application.Styles>
</Application>
```

::: tip
`#MiSans` is not the same in other font files, you can use a program like `Windows Font Viewer` to see the font name
:::
```
12 changes: 4 additions & 8 deletions docs/docs/zh/documentation/faq/custom-font.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 如何使用自定义字体

以下是创建一个新的 SukiUI 项目后的 `App.axaml` 文件:
以下是创建一个新的基于 SukiUI 项目后的 `App.axaml` 文件:

```xml
<Application xmlns="https://github.com/avaloniaui"
Expand All @@ -21,7 +21,7 @@
</Application>
```

假设存在一个字体文件 `Assets/MiSans-Bold.ttf`,并将其构建行为设置为 `AvaloniaResource`
假设存在一组字体文件 `Assets/FontName-xxx.ttf`,并将其构建行为设置为 `AvaloniaResource`

然后替换 `DefaultFontFamily` 为你的字体:

Expand All @@ -37,7 +37,7 @@

<Application.Resources> // [!code highlight]
<ResourceDictionary> // [!code highlight]
<FontFamily x:Key="DefaultFontFamily">avares://SukiTest/Assets/MiSans-Bold.ttf#MiSans</FontFamily> // [!code highlight]
<FontFamily x:Key="DefaultFontFamily">avares://YourProject/Assets#FontName</FontFamily> // [!code highlight]
</ResourceDictionary> // [!code highlight]
</Application.Resources> // [!code highlight]

Expand All @@ -49,8 +49,4 @@
<sukiUi:SukiTheme ThemeColor="Blue" />
</Application.Styles>
</Application>
```

::: tip
`#MiSans` 在其他字体中的名称都不一样,你可以使用类似 `Windows 字体查看器` 等软件查看字体名称
:::
```

0 comments on commit f116cc3

Please sign in to comment.