136 lines
3.3 KiB
Plaintext
136 lines
3.3 KiB
Plaintext
type BuFont = class(OpenXmlElement)
|
|
public
|
|
function Create();overload;
|
|
function Create(_node);overload;
|
|
function Create(_parent, _prefix, _local_name);overload;
|
|
function Init();override;
|
|
function InitAttributes();override;
|
|
function InitChildren();override;
|
|
function InitNode(_node);override;
|
|
function Copy(_obj);override;
|
|
|
|
property Typeface read ReadXmlAttrTypeface write WriteXmlAttrTypeface;
|
|
property Panose read ReadXmlAttrPanose write WriteXmlAttrPanose;
|
|
property PitchFamily read ReadXmlAttrPitchFamily write WriteXmlAttrPitchFamily;
|
|
property Charset read ReadXmlAttrCharset write WriteXmlAttrCharset;
|
|
function ReadXmlAttrTypeface();
|
|
function WriteXmlAttrTypeface(_value);
|
|
function ReadXmlAttrPanose();
|
|
function WriteXmlAttrPanose(_value);
|
|
function ReadXmlAttrPitchFamily();
|
|
function WriteXmlAttrPitchFamily(_value);
|
|
function ReadXmlAttrCharset();
|
|
function WriteXmlAttrCharset(_value);
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrTypeface;
|
|
XmlAttrPanose;
|
|
XmlAttrPitchFamily;
|
|
XmlAttrCharset;
|
|
|
|
// Children
|
|
|
|
end;
|
|
|
|
function BuFont.Create();overload;
|
|
begin
|
|
self.Create(nil, "a", "buFont");
|
|
end;
|
|
|
|
function BuFont.Create(_node);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node);
|
|
end;
|
|
|
|
function BuFont.Create(_parent, _prefix, _local_name);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_parent, _prefix, _local_name);
|
|
end;
|
|
|
|
function BuFont.Init();override;
|
|
begin
|
|
self.XmlAttrTypeface := new OpenXmlAttribute(nil, "typeface", nil);
|
|
self.XmlAttrPanose := new OpenXmlAttribute(nil, "panose", nil);
|
|
self.XmlAttrPitchFamily := new OpenXmlAttribute(nil, "pitchFamily", nil);
|
|
self.XmlAttrCharset := new OpenXmlAttribute(nil, "charset", nil);
|
|
end;
|
|
|
|
function BuFont.InitAttributes();override;
|
|
begin
|
|
attributes_ := array(
|
|
self.XmlAttrTypeface,
|
|
self.XmlAttrPanose,
|
|
self.XmlAttrPitchFamily,
|
|
self.XmlAttrCharset,
|
|
);
|
|
end;
|
|
|
|
function BuFont.InitChildren();override;
|
|
begin
|
|
child_elements_ := array(
|
|
);
|
|
sorted_child_ := array(
|
|
"": -1,
|
|
);
|
|
end;
|
|
|
|
function BuFont.InitNode(_node);override;
|
|
begin
|
|
if ifObj(self.XmlNode) then
|
|
for k,v in child_elements_ do v.InitNode(nil);
|
|
self.XmlNode := ifObj(_node) ? _node : nil;
|
|
end;
|
|
|
|
function BuFont.Copy(_obj);override;
|
|
begin
|
|
if not ifnil(_obj.XmlAttrTypeface.Value) then
|
|
self.XmlAttrTypeface.Value := _obj.XmlAttrTypeface.Value;
|
|
if not ifnil(_obj.XmlAttrPanose.Value) then
|
|
self.XmlAttrPanose.Value := _obj.XmlAttrPanose.Value;
|
|
if not ifnil(_obj.XmlAttrPitchFamily.Value) then
|
|
self.XmlAttrPitchFamily.Value := _obj.XmlAttrPitchFamily.Value;
|
|
if not ifnil(_obj.XmlAttrCharset.Value) then
|
|
self.XmlAttrCharset.Value := _obj.XmlAttrCharset.Value;
|
|
end;
|
|
|
|
function BuFont.ReadXmlAttrTypeface();
|
|
begin
|
|
return self.XmlAttrTypeface.Value;
|
|
end;
|
|
|
|
function BuFont.WriteXmlAttrTypeface(_value);
|
|
begin
|
|
self.XmlAttrTypeface.Value := _value;
|
|
end;
|
|
|
|
function BuFont.ReadXmlAttrPanose();
|
|
begin
|
|
return self.XmlAttrPanose.Value;
|
|
end;
|
|
|
|
function BuFont.WriteXmlAttrPanose(_value);
|
|
begin
|
|
self.XmlAttrPanose.Value := _value;
|
|
end;
|
|
|
|
function BuFont.ReadXmlAttrPitchFamily();
|
|
begin
|
|
return self.XmlAttrPitchFamily.Value;
|
|
end;
|
|
|
|
function BuFont.WriteXmlAttrPitchFamily(_value);
|
|
begin
|
|
self.XmlAttrPitchFamily.Value := _value;
|
|
end;
|
|
|
|
function BuFont.ReadXmlAttrCharset();
|
|
begin
|
|
return self.XmlAttrCharset.Value;
|
|
end;
|
|
|
|
function BuFont.WriteXmlAttrCharset(_value);
|
|
begin
|
|
self.XmlAttrCharset.Value := _value;
|
|
end;
|