public void Invoke(PdfContentStreamProcessor processor, PdfLiteral oper, List <PdfObject> operands)
{
PdfName dictionaryName = (PdfName)operands[0];
PdfDictionary extGState = processor.resources.GetAsDict(PdfName.EXTGSTATE);
if (extGState == null)
{
throw new ArgumentException(MessageLocalization.GetComposedMessage("resources.do.not.contain.extgstate.entry.unable.to.process.oper.1", oper));
}
PdfDictionary gsDic = extGState.GetAsDict(dictionaryName);
if (gsDic == null)
{
throw new ArgumentException(MessageLocalization.GetComposedMessage("1.is.an.unknown.graphics.state.dictionary", dictionaryName));
}
// at this point, all we care about is the FONT entry in the GS dictionary
PdfArray fontParameter = gsDic.GetAsArray(PdfName.FONT);
if (fontParameter != null)
{
CMapAwareDocumentFont font = processor.GetFont((PRIndirectReference)fontParameter[0]);
float size = fontParameter.GetAsNumber(1).FloatValue;
processor.Gs().font = font;
processor.Gs().fontSize = size;
}
}