2013-07-17 60 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會對瘦身字體產生偏見。 –

相關問題