/// <summary>
/// Writes the font definition to the document.
/// </summary>
/// <param name="writer">the PdfWriter of this document</param>
internal void WriteFont(PdfWriter writer)
{
switch (_fontType)
{
case BaseFont.FONT_TYPE_T3:
_baseFont.WriteFont(writer, _indirectReference, null);
break;
case BaseFont.FONT_TYPE_T1:
case BaseFont.FONT_TYPE_TT:
{
int firstChar;
int lastChar;
for (firstChar = 0; firstChar < 256; ++firstChar)
{
if (_shortTag[firstChar] != 0)
{
break;
}
}
for (lastChar = 255; lastChar >= firstChar; --lastChar)
{
if (_shortTag[lastChar] != 0)
{
break;
}
}
if (firstChar > 255)
{
firstChar = 255;
lastChar = 255;
}
_baseFont.WriteFont(writer, _indirectReference, new object[] { firstChar, lastChar, _shortTag, subset });
break;
}
case BaseFont.FONT_TYPE_CJK:
_baseFont.WriteFont(writer, _indirectReference, new object[] { _cjkTag });
break;
case BaseFont.FONT_TYPE_TTUNI:
_baseFont.WriteFont(writer, _indirectReference, new object[] { _longTag, subset });
break;
}
}