这里贴一段VB的代码,C#参照也是类似的,读取C盘字体库中的字体,判断字体是否存在,不存在即可使用特殊方法对字体进行安装

这对部分B/S搭建的软件还是能起到作用的,毕竟有些软件设置的字体在系统库中并不存在,如果不安得话,会出现各种乱码的情况,所以

才需要这么做

 Private Sub CheckPmingLiuFont() Implements IHealthCheck.CheckPmingLiuFont
        Try
            Dim Path As String = \"C:\\Windows\\Fonts\\mingliu.ttc\"
            Dim PFC As New PrivateFontCollection()
            If Path = \"C:\\Windows\\Fonts\\mingliu.ttc\" Then
                sbErrorLog.AppendLine()
            End If
        Catch ex As Exception
            sbErrorLog.AppendLine(\"Can\'t Find PMingLiu Font\")
        Finally
            Print(\"\")
        End Try
    End Sub

 

收藏 打印