可执行文件已创建,然后在Windows 2008 Server和Windows 2016 Server上运行,但符号未在Windows 2008 Server上渲染。你能帮我解决这个问题吗?
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
TextBox1.Text = "⑈" + "1234"
Me.TextBox1.AutoSize = False
Me.TextBox1.Height = 26
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
TextBox2.Text="⑆" + "5678"
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
'"files.encoding": "windows1252"
TextBox3.Text = "⑇" + "9876"
End Sub
End Class

发布于 2020-07-03 18:29:04
What are standard unicode fonts?暗示您必须在Server2008机器上将文本框的字体设置为Lucida Sans Unicode才能看到这些字形。
如下所示:
Private Function IsOldOS() As Boolean
' Regard Windows 7 and Windows Server 2008 (and earlier) as old operating systems.
' See https://stackoverflow.com/questions/2819934/detect-windows-version-in-net
Return Environment.OSVersion.Version.Major < 6 OrElse (Environment.OSVersion.Version.Major = 6 AndAlso Environment.OSVersion.Version.Minor <= 1)
End Function
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If IsOldOS() Then
' Use the Unicode font available on older machines.
' See https://stackoverflow.com/questions/9360394/what-are-standard-unicode-fonts
Dim fnt = New System.Drawing.Font("Lucida Sans Unicode", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
For Each tb In {TextBox1, TextBox2, TextBox3}
tb.Font = fnt
Next
End If
End Sub如果需要避免文本框更改大小,则可能需要调整字体的大小。您可能希望更改所有控件的字体,以保持其外观一致。
https://stackoverflow.com/questions/62712706
复制相似问题