gpt4 book ai didi

delphi - 为什么 FireMonkey 中压缩字体无法正确显示?

转载 作者:行者123 更新时间:2023-12-03 14:48:23 28 4
gpt4 key购买 nike

(我能做些什么呢?)

如果我在 VCL 中创建两个标签,并将其中一个设置为使用 Arial,另一个设置为 Arial Narrow,我将看到预期的结果。

enter image description here

如果我在 Firemonkey 中执行相同操作,第二个标签不会在 Arial Narrow 中显示。它甚至不在 Arial 中显示(i 上的点是圆形的,'s' 的形状都是错误的等等)。

enter image description here

有人知道为什么 FM(我用 Delphi XE4 测试过)不能正确显示字体吗?我能做点什么吗?

VCL 表单的来源:

object Form3: TForm3
Left = 0
Top = 0
Caption = 'Form3'
ClientHeight = 198
ClientWidth = 475
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 24
Top = 32
Width = 134
Height = 14
Caption = 'This label is using Arial @11'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
end
object Label2: TLabel
Left = 24
Top = 52
Width = 152
Height = 15
Caption = 'This label is using Arial Narrow @11'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial Narrow'
Font.Style = []
ParentFont = False
end
object Label3: TLabel
Left = 24
Top = 98
Width = 398
Height = 36
Caption = 'This label is using Arial @32'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -32
Font.Name = 'Arial'
Font.Style = []
ParentFont = False
end
object Label4: TLabel
Left = 24
Top = 140
Width = 429
Height = 37
Caption = 'This label is using Arial Narrow @32'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -32
Font.Name = 'Arial Narrow'
Font.Style = []
ParentFont = False
end
end

FM 表格来源:

object Form4: TForm4
Left = 0
Top = 0
Caption = 'Form4'
ClientHeight = 207
ClientWidth = 558
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [dkDesktop, dkiPhone, dkiPad]
DesignerMobile = False
DesignerWidth = 0
DesignerHeight = 0
DesignerDeviceName = ''
DesignerOrientation = 0
object Label1: TLabel
Font.Family = 'Arial'
StyledSettings = [ssSize, ssStyle, ssFontColor]
Height = 17.000000000000000000
Position.X = 16.000000000000000000
Position.Y = 32.000000000000000000
Text = 'This label is using Arial @11'
Width = 225.000000000000000000
end
object Label2: TLabel
Font.Family = 'Arial Narrow'
StyledSettings = [ssSize, ssStyle, ssFontColor]
Height = 17.000000000000000000
Position.X = 16.000000000000000000
Position.Y = 48.000000000000000000
Text = 'This label is using Arial Narrow @11'
Width = 225.000000000000000000
end
object Label3: TLabel
Font.Family = 'Arial'
Font.Size = 32.000000000000000000
StyledSettings = [ssStyle, ssFontColor]
Height = 41.000000000000000000
Position.X = 16.000000000000000000
Position.Y = 104.000000000000000000
Text = 'This label is using Arial @32'
Width = 433.000000000000000000
end
object Label4: TLabel
Font.Family = 'Arial Narrow'
Font.Size = 32.000000000000000000
StyledSettings = [ssStyle, ssFontColor]
Height = 65.000000000000000000
Position.X = 16.000000000000000000
Position.Y = 128.000000000000000000
Text = 'This label is using Arial Narrow @32'
Width = 545.000000000000000000
end
end

最佳答案

这似乎只影响家族中的字体 - 如果该字体不存在于其自己的家族名称下的字体文件夹中。例如,Arial Narrow 是“Arial”字体文件中的一种字体(它存在于一个系列中,但本身并不是一个系列)。

通常,字体系列仅包含四种样式

Arial(天真的包含)

  • Arial 常规
  • Arial 粗体
  • Arial 斜体
  • Arial 粗斜体

然而,“Arial Narrow”与标准样式一起存在于“Arial”家族中 - 即:

Arial(实际包含)

  • Arial 常规
  • Arial 粗体
  • Arial 斜体
  • Arial 粗斜体
  • 窄体宋体
  • Arial 窄粗体
  • Arial 窄斜体
  • Arial 窄粗斜体
  • 宋体黑

似乎 FMX 只在任何给定字体系列中深入查找一层,并且不会查找任何偏离严格 GDI+ 样式定义(常规、粗体、斜体、粗体斜体)的样式变体。

通过检查,这也会影响 Arial Black - 通过运行字体文件夹很容易找到其他示例。 Franklin Gothic Demi、Gill Sans Ultra Bold 等...任何遵循上述模式的内容。当遇到这些字体时,该字体似乎会在默认的 Segoe UI 中呈现。

权宜之计是使用 Arial 并将 Scale 属性设置为 X=0.82 - 它并不完美,但非常接近 Arial Narrow。

Arial stretch vs Arial Narrow

这可能是一个错误,应该进行质量控制。

关于delphi - 为什么 FireMonkey 中压缩字体无法正确显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17701006/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com