Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Resizer: variable font files: unable to load valid file names

未关闭
#1,143 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
android, csharp

调研方向

该失败指向第 568 行的 Microsoft.Maui.Resizetizer.After.targets,而复现使用了 ConfigureFonts 中的 OpenSans-VariableFont_wdth,wght.ttf。首先使用该可变字体复现 MSBuild 错误,然后检查 target 如何处理文件名,并通过一次干净的重新构建验证结果。

由索引模型根据 Issue 内容生成。

描述

bug :bug:
Describe the bug

When you download font from https://fonts.google.com/specimen/Open+Sans
you have the choice to use a "variable" font file.

"variable" font files contains alternative axes. Foe ex:
wdth
wght
This is more practical than to use many static font files to get BOLD, MEDIUM etc ...

Both android 12+ and iOS 11+ support variable font files.

Example of a valid file name:
OpenSans-Italic-VariableFont_wdth,wght.ttf

When you add that file to the Fonts folder, resizer crashes.

1>Microsoft.Maui.Resizetizer.After.targets(568,17): Error MSB4186 : Invalid static method invocation syntax: "[System.IO.Path]::GetFileName(obj\Debug\net10.0-android\android-x64\resizetizer\f\OpenSans-VariableFont_wdth,wght.ttf)". Method 'System.IO.Path.GetFileName' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)). Check that all parameters are defined, are of the correct type, and are specified in the right order.

When you rename the file, resizer continues to crash. Until your clean and rebuild.

Regression

No response

Steps to reproduce

You can download the font "OpenSans" on google font.
Both android 12+ and iOS 11+ support variable font files.

        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .UseMauiCommunityToolkit()
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-VariableFont_wdth,wght.ttf", "OpenSans");
            });
``



### Expected behavior

don't crash :)

### Screenshots

_No response_

### IDE and version

Rider

### IDE version

2025.3.0.1

### Nuget packages

- [ ] CommunityToolkit.Common
- [ ] CommunityToolkit.Diagnostics
- [ ] CommunityToolkit.HighPerformance
- [ ] CommunityToolkit.Mvvm (aka MVVM Toolkit)

### Nuget package version(s)

10.0.10

### Additional context

- OS: Window 11
- Target: maui android 10
- VS 2026


### Help us help you

No, just wanted to report this
主要语言
C#
星标
3.8k
派生
402
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CommunityToolkit/dotnet 的其他 Issue

查看 CommunityToolkit/dotnet 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。