Esempio n. 1
0
void CFFANSIFontWriter::WriteCharSet(	DictionaryContext* inDescriptorContext,
                                        ObjectsContext* inObjectsContext,
                                        FreeTypeFaceWrapper* inFontInfo,
                                        const UIntAndGlyphEncodingInfoVector& inEncodedGlyphs)
{
    // ChartSet
    inDescriptorContext->WriteKey(scCharSet);

    // charset is a rather long string. i'd rather write it down as it goes, than format a string
    // and submit it.
    IByteWriterWithPosition* directStream = inObjectsContext->StartFreeContext();
    PrimitiveObjectsWriter primitiveWriter(directStream);

    directStream->Write(scLeftParanthesis,1);

    UIntAndGlyphEncodingInfoVector::const_iterator it = inEncodedGlyphs.begin()+1; // skip 0 character

    for(; it != inEncodedGlyphs.end(); ++it)
    {
        std::string glyphName = inFontInfo->GetGlyphName(it->first);
        primitiveWriter.WriteName(glyphName.c_str(),eTokenSepratorNone);
    }
    directStream->Write(scRightParanthesis,1);
    inObjectsContext->EndFreeContext();
    inObjectsContext->EndLine();
}
void DictionaryContext::WriteIndents()
{
	IByteWriterWithPosition* outputStream = mObjectsContext->StartFreeContext();
	for(size_t i=0;i<=mIndentLevel;++i)
		outputStream->Write(scTab,1);
	mObjectsContext->EndFreeContext();
}