Support for Mac font substitutions in form files.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1435 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
macpgmr
2011-01-11 22:19:22 +00:00
parent d74dbbbe55
commit 9aa37ba20f
2 changed files with 18 additions and 8 deletions

View File

@ -133,16 +133,20 @@ THTMLViewer=
; http://dustinbrewer.com/popular-fonts-with-their-mac-osx-windows-and-linux-equivalents/
; http://mondaybynoon.com/2007/04/02/linux-font-equivalents-to-popular-web-typefaces/
; Note that if you're targeting a specific platform, you can use this to
; substitute normal fonts for that platform, for example if targeting Mac:
; Arial=Lucida Grande
[FontSubstitutes]
MS Sans Serif=Arial
MS Serif=Times New Roman
System=Arial
; With both the -s and -m switches, substitute these fonts first
; before any fonts listed under [FontSubstitutes].
[MacFontSubstitutes]
Arial=Lucida Grande
;Arial=Helvetica
; These controls cannot receive focus on Mac, so with -m switch
; add TabStop = False so tabbing skips over them.
@ -152,5 +156,5 @@ TBitBtn=
TComboBox=
TCheckBox=
TRadioGroup=
;TListBox=
TListBox=
TPageControl=

View File

@ -310,10 +310,16 @@ begin
begin
StripStr := Copy(InStr, Pos('=', InStr)+3, MaxInt); {Name after quote}
Delete(StripStr, Length(StripStr), 1); {Delete closing quote}
if CfgFileObj.ValueExists('FontSubstitutes', StripStr) then
if MacSwitch and
CfgFileObj.ValueExists('MacFontSubstitutes', StripStr) then
WriteLn(LfmFileVar,
Copy(InStr, 1, Succ(Pos('=', InStr))), '''',
CfgFileObj.ReadString('FontSubstitutes', StripStr, 'Arial'),
CfgFileObj.ReadString('MacFontSubstitutes', StripStr, ''),
'''')
else if CfgFileObj.ValueExists('FontSubstitutes', StripStr) then
WriteLn(LfmFileVar,
Copy(InStr, 1, Succ(Pos('=', InStr))), '''',
CfgFileObj.ReadString('FontSubstitutes', StripStr, ''),
'''')
else
WriteLn(LfmFileVar, InStr);