Ignore:
Timestamp:
Jun 13, 2007, 8:33:51 PM (18 years ago)
Author:
RBRi
Message:

using StringUtilsUnit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Components/CustomFontDialog.PAS

    r15 r214  
    44
    55Uses
    6   Classes, Forms, Dialogs, StdCtrls, Buttons, Graphics;
     6  Classes,
     7  Forms,
     8  Dialogs,
     9  StdCtrls,
     10  Buttons,
     11  Graphics;
    712
    813Type
     
    8287
    8388uses
    84   SysUtils, PmWin,
    85   ACLStringUtility;
     89  SysUtils,
     90  PmWin,
     91  StringUtilsUnit;
    8692
    8793// Returns true if s ends with endstr (case insensitive)
     
    128134begin
    129135  Result := Font.Family;
    130   Result := SubstituteChar( Result, '-', ' ' );
    131   Result := SubstituteChar( Result, '_', ' ' );
     136  SubstituteAllOccurencesOfChar( Result, '-', ' ' );
     137  SubstituteAllOccurencesOfChar( Result, '_', ' ' );
    132138
    133139  if Result = 'Roman' then
    134     if StrStarts( 'Tms Rmn', Font.FaceName ) then
     140    if StrStartsWithIgnoringCase( 'Tms Rmn', Font.FaceName ) then
    135141      // one particularly stupid example
    136142      Result := 'Tms Rmn';
    137143
    138144  if Result = 'Swiss' then
    139     if StrStarts( 'Helv', Font.FaceName ) then
     145    if StrStartsWithIgnoringCase( 'Helv', Font.FaceName ) then
    140146      // one particularly stupid example
    141147      Result := 'Helv';
     
    151157begin
    152158  Result := Font.FaceName;
    153   Result := SubstituteChar( Result, '-', ' ' );
    154   Result := SubstituteChar( Result, '_', ' ' );
     159  SubstituteAllOccurencesOfChar( Result, '-', ' ' );
     160  SubstituteAllOccurencesOfChar( Result, '_', ' ' );
    155161
    156162  FamilyName := GetFontFamilyName( Font );
    157   if StrStarts( FamilyName, Result ) then
     163  if StrStartsWithIgnoringCase( FamilyName, Result ) then
    158164  begin
    159     Result := StrRightFrom( Result, length( FamilyName ) + 1 );
    160     Result := TrimChars( Result, [ ' ', '-', '_' ] );
     165    Result := StrSubstringFrom( Result, length( FamilyName ) + 1 );
     166    Result := StrTrimChars( Result, [ ' ', '-', '_' ] );
    161167
    162168    if Result = '' then
Note: See TracChangeset for help on using the changeset viewer.