public static string GetKnownFontstring(RTFFont font) { string value = string.Empty; switch (font) { case RTFFont.Arial: value = Arial; break; case RTFFont.ArialBlack: value = ArialBlack; break; case RTFFont.BookmanOldStyle: value = BookmanOldStyle; break; case RTFFont.Broadway: value = Broadway; break; case RTFFont.CenturyGothic: value = CenturyGothic; break; case RTFFont.Consolas: value = Consolas; break; case RTFFont.CordiaNew: value = CordiaNew; break; case RTFFont.CourierNew: value = CourierNew; break; case RTFFont.FontTimesNewRoman: value = FontTimesNewRoman; break; case RTFFont.Garamond: value = Garamond; break; case RTFFont.Georgia: value = Georgia; break; case RTFFont.Impact: value = Impact; break; case RTFFont.LucidaConsole: value = LucidaConsole; break; case RTFFont.Symbol: value = Symbol; break; case RTFFont.WingDings: value = WingDings; break; case RTFFont.MSSansSerif: value = MSSansSerif; break; default: throw new ArgumentOutOfRangeException("font"); } return value; }
/// <summary> /// Indexes the of font. /// </summary> /// <param name="font">The font.</param> /// <returns></returns> public int IndexOfFont(RTFFont font, byte charset) { string s = RTFBuilder.RawFonts.GetKnownFontstring(font); if (charset != 0) { s = s.Replace(@"\fcharset0 ", @"\fcharset" + charset.ToString()); } return(IndexOfRawFont(s)); }
protected Font LookupFont(RTFFont defaultFont, float defaultFontSize) { try { return(new Font(defaultFont.ToString(), defaultFontSize)); } catch { return(SystemFonts.DefaultFont); } }
protected RTFBuilderbase(RTFFont defaultFont, float defaultFontSize) { _rawFonts = new StringCollection(); this._font = IndexOfFont(defaultFont); this._defaultFontSize = defaultFontSize; this._fontSize = this._defaultFontSize; this._defaultforecolor = SystemColors.WindowText; this._defaultbackcolor = SystemColors.Window; this._colortbl = new List <Color>(); this._colortbl.Add(this._defaultforecolor); this._colortbl.Add(this._defaultbackcolor); this._fontStyle = System.Drawing.FontStyle.Regular; this._backcolor = this._defaultbackcolor; this._forecolor = this._defaultforecolor; this._sf = (StringFormat)StringFormat.GenericDefault.Clone(); this._sf.FormatFlags = StringFormatFlags.NoWrap; this._sf.Trimming = StringTrimming.Word; }
protected RTFBuilderBase(RTFFont defaultFont, float defaultFontSize) { _rawFonts = new StringCollection(); this._font = IndexOfFont(defaultFont); this._defaultFontSize = defaultFontSize; this._fontSize = this._defaultFontSize; this._defaultforecolor = SystemColors.WindowText; this._defaultbackcolor = SystemColors.Window; this._colortbl = new List <Color>(); this._colortbl.Add(this._defaultforecolor); this._colortbl.Add(this._defaultbackcolor); this._fontStyle = System.Drawing.FontStyle.Regular; this._backcolor = this._defaultbackcolor; this._forecolor = this._defaultforecolor; this._sf = (StringFormat) StringFormat.GenericDefault.Clone(); this._sf.FormatFlags = StringFormatFlags.NoWrap; this._sf.Trimming = StringTrimming.Word; }
protected RTFBuilderbase(RTFFont defaultFont, float defaultFontSize, ushort codepage, byte charset) { _rawFonts = new StringCollection(); DefLang = codepage; _font = IndexOfFont(defaultFont, charset); _defaultFontSize = defaultFontSize; _fontSize = _defaultFontSize; _defaultforecolor = SystemColors.WindowText; _defaultbackcolor = SystemColors.Window; _colortbl = new List<Color>(); _colortbl.Add(_defaultforecolor); _colortbl.Add(_defaultbackcolor); _fontStyle = System.Drawing.FontStyle.Regular; _backcolor = _defaultbackcolor; _forecolor = _defaultforecolor; _sf = (StringFormat) StringFormat.GenericDefault.Clone(); _sf.FormatFlags = StringFormatFlags.NoWrap; _sf.Trimming = StringTrimming.Word; _sysfont = LookupFont(defaultFont, defaultFontSize); }
protected RTFBuilderbase(RTFFont defaultFont, float defaultFontSize, ushort codepage, byte charset) { _rawFonts = new StringCollection(); DefLang = codepage; _font = IndexOfFont(defaultFont, charset); _defaultFontSize = defaultFontSize; _fontSize = _defaultFontSize; _defaultforecolor = SystemColors.WindowText; _defaultbackcolor = SystemColors.Window; _colortbl = new List <Color>(); _colortbl.Add(_defaultforecolor); _colortbl.Add(_defaultbackcolor); _fontStyle = System.Drawing.FontStyle.Regular; _backcolor = _defaultbackcolor; _forecolor = _defaultforecolor; _sf = (StringFormat)StringFormat.GenericDefault.Clone(); _sf.FormatFlags = StringFormatFlags.NoWrap; _sf.Trimming = StringTrimming.Word; _sysfont = LookupFont(defaultFont, defaultFontSize); }
public RTFBuilderbase Font(RTFFont font) { this._font = IndexOfFont(font); return(this); }
/// <summary> /// Indexes the of font. /// </summary> /// <param name="font">The font.</param> /// <returns></returns> public int IndexOfFont(RTFFont font) { return IndexOfFont(font, 0); }
/// <summary> /// Indexes the of font. /// </summary> /// <param name="font">The font.</param> /// <returns></returns> public int IndexOfFont(RTFFont font) { return(IndexOfRawFont(RTFBuilder.RawFonts.GetKnownFontstring(font))); }
public RTFBuilder(RTFFont defaultFont, float defaultFontSize) : base(defaultFont, defaultFontSize) { this._sb = new StringBuilder(); }
public RTFBuilder(RTFFont defaultFont) : base(defaultFont, 20F) { this._sb = new StringBuilder(); }
public RTFBuilder(RTFFont defaultFont, float defaultFontSize, ushort codepage, byte charset) : base(defaultFont, defaultFontSize, codepage, charset) { _sb = new StringBuilder(); }
/// <summary> /// Indexes the of font. /// </summary> /// <param name="font">The font.</param> /// <returns></returns> public int IndexOfFont(RTFFont font, byte charset) { string s = RTFBuilder.RawFonts.GetKnownFontstring(font); if (charset != 0) s = s.Replace(@"\fcharset0 ", @"\fcharset" + charset.ToString()); return IndexOfRawFont(s); }
/// <summary> /// Indexes the of font. /// </summary> /// <param name="font">The font.</param> /// <returns></returns> public int IndexOfFont(RTFFont font) { return IndexOfRawFont(RTFBuilder.RawFonts.GetKnownFontstring(font)); }
protected RTFBuilderbase(RTFFont defaultFont, float defaultFontSize) : this(defaultFont, defaultFontSize, 1252, 0) { }
/// <summary> /// Indexes the of font. /// </summary> /// <param name="font">The font.</param> /// <returns></returns> public int IndexOfFont(RTFFont font) { return(IndexOfFont(font, 0)); }
protected Font LookupFont(RTFFont defaultFont, float defaultFontSize) { try { return new Font(defaultFont.ToString(), defaultFontSize); } catch { return SystemFonts.DefaultFont; } }
public RTFBuilderBase Font(RTFFont font) { this._font = IndexOfFont(font); return this; }
public static string GetKnownFontstring(RTFFont font) { string value = string.Empty; switch (font) { case RTFFont.Arial: value = Arial; break; case RTFFont.ArialBlack: value = ArialBlack; break; case RTFFont.BookmanOldStyle: value = BookmanOldStyle; break; case RTFFont.Broadway: value = Broadway; break; case RTFFont.CenturyGothic: value = CenturyGothic; break; case RTFFont.Consolas: value = Consolas; break; case RTFFont.CordiaNew: value = CordiaNew; break; case RTFFont.CourierNew: value = CourierNew; break; case RTFFont.FontTimesNewRoman: value = FontTimesNewRoman; break; case RTFFont.Garamond: value = Garamond; break; case RTFFont.Georgia: value = Georgia; break; case RTFFont.Impact: value = Impact; break; case RTFFont.LucidaConsole: value = LucidaConsole; break; case RTFFont.Symbol: value = Symbol; break; case RTFFont.WingDings: value = WingDings; break; case RTFFont.MSSansSerif: value = MSSansSerif; break; default: throw new ArgumentOutOfRangeException("font"); } return(value); }