2013-07-17 61 views
8

(我能做些什么呢?)为什么浓缩字体在FireMonkey中不能正确显示?

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

enter image description here

如果我做同样的Firemonkey,第二个标签不以Arial Narrow显示。它甚至没有显示在Arial(圆点上的圆点,'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 

来源为调频形式:

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 
+0

您对“正确”的定义是什么?为什么你断言VCL是正确的,而FMX不是? –

+0

Arial Narrow不是默认的Windows字体。它通过Windows Office套件安装。您是否尝试通过任何其他字体来重现此问题?您是否尝试在另一台计算机上重现此问题?随着窗口,很多可以影响如何呈现字体。 – Peter

+4

@DavidHeffernan:正如我所指出的,FM表示显然不是Arial家族的字体。 – gabr

回答

6

这似乎只影响家庭内的字体 - 如果字体不中的字体存在的文件夹下它自己的姓氏。例如,Arial Narrow是“Arial”字体文件中的一种字体(它存在于一个家庭中,本身不是一个家庭)。

通常字体系列将包括四种风格只

宋体(天真地包含)

  • 宋体定期
  • Arial粗体
  • 宋体斜体
  • Arial粗体斜体

“Arial Narrow字体”,然而, “宋体” 家庭中存在旁边的标准样式 - 即:

宋体(实际上包含)

  • 宋体定期
  • Arial粗体
  • Arial Italic
  • Arial Bold Italic
  • Arial Narrow
  • 窄Arial粗体
  • 窄Arial斜体
  • 窄Arial粗斜体
  • 宋体黑色

似乎FMX只寻找任何给定的字体家族中的一个层次深,不看任何样式变体偏离严格的GDI +样式定义(Regular,Bold,Italic,Bold Italic)。

这也可以通过检查来影响Arial Black - 其他示例通过运行字体文件夹很容易找到。富兰克林哥特式黛米,吉尔超超大胆等等......任何遵循上述模式的东西。遇到这些字体时,字体似乎在默认的Segoe UI中呈现。

权限管理解决方案是使用Arial并将Scale属性设置为X=0.82 - 这并不完美,但它非常接近Arial Narrow。

Arial stretch vs Arial Narrow

这可能是一个错误,应当经过质量检验。

+0

我注意到了这一点,在VCL中,如果你在对象检查器中键入例如Segoe UI semibold这是Segoe UI的子字体,它将正确显示它。但在Firemonkey中做同样的事情不会产生正确的字体。 – Peter

+0

@J ...我派生了我自己的浓缩字体,并将它安装在没有任何子字体系列的新名称下。我曾尝试在FMX中使用此字体,但未被识别,因此被Segoe UI取代。在写字板我的字体正常工作。所以这个问题不仅影响到家庭内的字体。 – slotomo

+0

@slotomo - 字体构建可能会很棘手,我会很有兴趣看到这种字体。我想很可能是严格标准的某些方面没有遵守。毫无意义的是,FMX会对瘦身字体产生偏见。 –

相关问题