Changeset 214 for trunk/Components/CustomFontDialog.PAS
- Timestamp:
- Jun 13, 2007, 8:33:51 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Components/CustomFontDialog.PAS
r15 r214 4 4 5 5 Uses 6 Classes, Forms, Dialogs, StdCtrls, Buttons, Graphics; 6 Classes, 7 Forms, 8 Dialogs, 9 StdCtrls, 10 Buttons, 11 Graphics; 7 12 8 13 Type … … 82 87 83 88 uses 84 SysUtils, PmWin, 85 ACLStringUtility; 89 SysUtils, 90 PmWin, 91 StringUtilsUnit; 86 92 87 93 // Returns true if s ends with endstr (case insensitive) … … 128 134 begin 129 135 Result := Font.Family; 130 Result := SubstituteChar( Result, '-', ' ' );131 Result := SubstituteChar( Result, '_', ' ' );136 SubstituteAllOccurencesOfChar( Result, '-', ' ' ); 137 SubstituteAllOccurencesOfChar( Result, '_', ' ' ); 132 138 133 139 if Result = 'Roman' then 134 if StrStarts ( 'Tms Rmn', Font.FaceName ) then140 if StrStartsWithIgnoringCase( 'Tms Rmn', Font.FaceName ) then 135 141 // one particularly stupid example 136 142 Result := 'Tms Rmn'; 137 143 138 144 if Result = 'Swiss' then 139 if StrStarts ( 'Helv', Font.FaceName ) then145 if StrStartsWithIgnoringCase( 'Helv', Font.FaceName ) then 140 146 // one particularly stupid example 141 147 Result := 'Helv'; … … 151 157 begin 152 158 Result := Font.FaceName; 153 Result := SubstituteChar( Result, '-', ' ' );154 Result := SubstituteChar( Result, '_', ' ' );159 SubstituteAllOccurencesOfChar( Result, '-', ' ' ); 160 SubstituteAllOccurencesOfChar( Result, '_', ' ' ); 155 161 156 162 FamilyName := GetFontFamilyName( Font ); 157 if StrStarts ( FamilyName, Result ) then163 if StrStartsWithIgnoringCase( FamilyName, Result ) then 158 164 begin 159 Result := Str RightFrom( Result, length( FamilyName ) + 1 );160 Result := TrimChars( Result, [ ' ', '-', '_' ] );165 Result := StrSubstringFrom( Result, length( FamilyName ) + 1 ); 166 Result := StrTrimChars( Result, [ ' ', '-', '_' ] ); 161 167 162 168 if Result = '' then
Note:
See TracChangeset
for help on using the changeset viewer.