public TextProps(byte[] b) { using (var st = new MemoryStream(b)) using (var r = new FrxReader(st)) { MinorVersion = r.ReadByte(); MajorVersion = r.ReadByte(); var cbTextProps = r.ReadUInt16(); PropMask = new TextPropsPropMask(r.ReadUInt32()); // DataBlock var fontNameCcb = PropMask.HasFontName ? r.ReadCcb() : Tuple.Create(0, false); FontEffects = PropMask.HasFontEffects ? r.ReadUInt32() : 0; FontHeight = PropMask.HasFontHeight ? r.ReadUInt32() : 0; FontCharSet = PropMask.HasFontCharSet ? r.ReadByte() : (byte)0; FontPitchAndFamily = PropMask.HasFontPitchAndFamily ? r.ReadByte() : (byte)0; ParagraphAlign = PropMask.HasParagraphAlign ? r.ReadByte() : (byte)0; FontWeight = PropMask.HasFontWeight ? r.ReadUInt16() : (ushort)0; // ExtraDataBlock FontName = r.ReadStringFromCcb(fontNameCcb); } }
protected bool Equals(TextPropsPropMask other) { return(HasFontName == other.HasFontName && HasFontEffects == other.HasFontEffects && HasFontHeight == other.HasFontHeight && HasFontCharSet == other.HasFontCharSet && HasFontPitchAndFamily == other.HasFontPitchAndFamily && HasParagraphAlign == other.HasParagraphAlign && HasFontWeight == other.HasFontWeight); }