Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
$fontPath = "C:\Windows\Fonts\courbd.ttf"
try {
if (!(Test-Path -Path $fontPath -PathType Leaf)) {
throw "在路径 $fontPath 未找到字体文件"
}
$fontFamily = [System.Drawing.FontFamily]::new($fontPath)
Write-Host "字体文件 '$fontPath' 有效。字体族名称:$($fontFamily.Name)"
} catch {
Write-Error "加载字体文件 '$fontPath' 时出错:$($_.Exception.Message)"
# 可在此处添加更具体的错误处理,例如检查特定异常类型。
}