Procedure TWPAttrCache.EnumCharAttr(param:TObject; Proc:TWPAttrCacheEnumProc)
Unit: WPRTEDefs
Class: WPRTEDefs.TWPAttrCache
Parameters
-
param:TObject Proc:TWPAttrCacheEnumProc
Description
This procedure enumerates all character attribute records which are currently used and calls a callback routine.Example - set the charset 1 in all occurances of the font "Free 3 of 9 Extended":
procedure TForm1.EnumCA(index : Integer;
var ca : TWPCharAttr; param : TObject);
begin
if ca.Values[WPAT_CharFont]=Integer(param) then
ca.Values[WPAT_CharCharset]:=1; // Set the charset
end;
procedure TForm1.ChangeCharsetClick(Sender: TObject);
var n : Integer;
begin
n := WPRichText1.HeaderFooter.RTFProps.AddFontName('Free 3 of 9 Extended');
WPRichText1.HeaderFooter.RTFProps.Attributes.EnumCharAttr(
TObject(n), EnumCA );
end;