Commit f31cfb0
fix(social): don't crash when no font is available; ship a font in the image
The social-cards plugin failed the entire build inside the container with
"SixLabors.Fonts.FontException: Cannot use the default value type instance
to create a font". Two causes:
1. ResolveFontFamily()'s last-resort `SystemFonts.Families.FirstOrDefault()`
returns a *default* FontFamily struct (not null) when no fonts are
installed, so the `family is null` guard missed it and CreateFont threw.
Now we detect the default and return null, so card generation is skipped
with a warning instead of failing the build.
2. The minimal runtime-deps container has no fonts at all. Install
fonts-dejavu-core + fontconfig in the image so social cards actually
render (ResolveFontFamily already prefers "DejaVu Sans").
Also enable the social plugin on docs-site so the container path is
exercised by the action self-test. Verified locally: docs-site build emits
34 social cards. Removes the temporary deploy-test workflow.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent e97155b commit f31cfb0
4 files changed
Lines changed: 24 additions & 40 deletions
File tree
- .github/workflows
- docs-site
- src/Netdocs.Plugins
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
128 | 141 | | |
129 | 142 | | |
130 | 143 | | |
| |||
0 commit comments