/** * Imports a font. The font name is looked up in the RtfDocumentHeader and * then the mapping from original font number to actual font number is added. * * @param fontNr The original font number. * @param fontName The font name to look up. * @param charset The characterset to use for the font. */ public bool ImportFont(String fontNr, String fontName, int charset) { RtfFont rtfFont = new RtfFont(fontName); if (charset >= 0) { rtfFont.SetCharset(charset); } rtfFont.SetRtfDocument(this.rtfDoc); this.importFontMapping[fontNr] = this.rtfDoc.GetDocumentHeader().GetFontNumber(rtfFont).ToString(); return(true); }
/// <summary> /// Imports a font. The font name is looked up in the RtfDocumentHeader and /// then the mapping from original font number to actual font number is added. /// </summary> /// <param name="fontNr">The original font number.</param> /// <param name="fontName">The font name to look up.</param> /// <param name="charset">The characterset to use for the font.</param> public bool ImportFont(string fontNr, string fontName, int charset) { var rtfFont = new RtfFont(fontName); if (charset >= 0) { rtfFont.SetCharset(charset); } rtfFont.SetRtfDocument(_rtfDoc); _importFontMapping[fontNr] = _rtfDoc.GetDocumentHeader().GetFontNumber(rtfFont).ToString(); return(true); }
/// <summary> /// Imports a font. The font name is looked up in the RtfDocumentHeader and /// then the mapping from original font number to actual font number is added. /// </summary> /// <param name="fontNr">The original font number.</param> /// <param name="fontName">The font name to look up.</param> /// <param name="fontFamily"></param> /// <param name="charset">The characterset to use for the font.</param> public bool ImportFont(string fontNr, string fontName, string fontFamily, int charset) { RtfFont rtfFont = new RtfFont(fontName); if (charset >= 0) { rtfFont.SetCharset(charset); } if (!string.IsNullOrEmpty(fontFamily)) { rtfFont.SetFamily(fontFamily); } rtfFont.SetRtfDocument(_rtfDoc); _importFontMapping[fontNr] = _rtfDoc.GetDocumentHeader().GetFontNumber(rtfFont).ToString(); return(true); }