"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Plugins/Pdf/PDFWriter/CFFANSIFontWriter.cpp" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

CFFANSIFontWriter.cpp  (TeXmacs-1.99.4-src):CFFANSIFontWriter.cpp  (TeXmacs-1.99.5-src)
skipping to change at line 51 skipping to change at line 51
CFFANSIFontWriter::~CFFANSIFontWriter(void) CFFANSIFontWriter::~CFFANSIFontWriter(void)
{ {
} }
static const std::string scType1C = "Type1C"; static const std::string scType1C = "Type1C";
static const char* scType1Type = "Type 1"; static const char* scType1Type = "Type 1";
static const char* scCFF = "CFF"; static const char* scCFF = "CFF";
static const std::string scPlus = "+"; static const std::string scPlus = "+";
EStatusCode CFFANSIFontWriter::WriteFont( FreeTypeFaceWrapper& inFontInfo, EStatusCode CFFANSIFontWriter::WriteFont( FreeTypeFaceWrapper& inFontInfo,
WrittenFontRepresentation* inFontOccurrence, WrittenFontRepresentation* inFontOccurrence,
ObjectsContext* inObjectsContext) ObjectsContext* inObjectsContext,
bool inEmbedFont)
{ {
const char* postscriptFontName = FT_Get_Postscript_Name(inFontInfo); std::string postscriptFontName = inFontInfo.GetPostscriptName();
if(!postscriptFontName) if(postscriptFontName.length() == 0)
{ {
TRACE_LOG("CFFANSIFontWriter::WriteFont, unexpected failure. no p ostscript font name for font"); TRACE_LOG("CFFANSIFontWriter::WriteFont, unexpected failure. no p ostscript font name for font");
return PDFHummus::eFailure; return PDFHummus::eFailure;
} }
std::string subsetFontName = inObjectsContext->GenerateSubsetFontPrefix() std::string fontName;
+ scPlus + postscriptFontName;
const char* fontType = inFontInfo.GetTypeString();
// reset embedded font object ID (and flag...to whether it was actually e mbedded or not, which may // reset embedded font object ID (and flag...to whether it was actually e mbedded or not, which may
// happen due to font embedding restrictions) // happen due to font embedding restrictions)
mEmbeddedFontFileObjectID = 0; mEmbeddedFontFileObjectID = 0;
EStatusCode status; if (inEmbedFont)
if(strcmp(scType1Type,fontType) == 0)
{
Type1ToCFFEmbeddedFontWriter embeddedFontWriter;
status = embeddedFontWriter.WriteEmbeddedFont(inFontInfo,
inFontOccurrence->GetGlyphIDsAsOrderedVector(),
scType1C,
subsetFontName,
inObjectsContext,
mEmbeddedFontFileObjectID);
}
else if(strcmp(scCFF,fontType) == 0)
{ {
CFFEmbeddedFontWriter embeddedFontWriter; fontName = inObjectsContext->GenerateSubsetFontPrefix() + scPlus
+ postscriptFontName;
const char* fontType = inFontInfo.GetTypeString();
status = embeddedFontWriter.WriteEmbeddedFont(inFontInfo, EStatusCode status;
if (strcmp(scType1Type, fontType) == 0)
inFontOccurrence->GetGlyphIDsAsOrderedVector(), {
Type1ToCFFEmbeddedFontWriter embeddedFontWriter;
scType1C,
status = embeddedFontWriter.WriteEmbeddedFont(inFontInfo,
subsetFontName, inFontOccurrence->GetGlyphIDsAsOrderedVector(),
scType1C,
inObjectsContext, fontName,
inObjectsContext,
mEmbeddedFontFileObjectID); mEmbeddedFontFileObjectID);
}
else if (strcmp(scCFF, fontType) == 0)
{
CFFEmbeddedFontWriter embeddedFontWriter;
status = embeddedFontWriter.WriteEmbeddedFont(inFontInfo,
inFontOccurrence->GetGlyphIDsAsOrderedVector(),
scType1C,
fontName,
inObjectsContext,
mEmbeddedFontFileObjectID);
}
else
{
TRACE_LOG("CFFANSIFontWriter::WriteFont, Exception, unfam
ilar font type for embedding representation");
status = PDFHummus::eFailure;
}
if (status != PDFHummus::eSuccess)
return status;
} }
else else
{ fontName = postscriptFontName;
TRACE_LOG("CFFANSIFontWriter::WriteFont, Exception, unfamilar fon
t type for embedding representation");
status = PDFHummus::eFailure;
}
if(status != PDFHummus::eSuccess)
return status;
ANSIFontWriter fontWriter; ANSIFontWriter fontWriter;
return fontWriter.WriteFont(inFontInfo,inFontOccurrence,inObjectsContext, this,subsetFontName); return fontWriter.WriteFont(inFontInfo, inFontOccurrence, inObjectsContex t, this, fontName);
} }
static const char* scType1 = "Type1"; static const char* scType1 = "Type1";
void CFFANSIFontWriter::WriteSubTypeValue(DictionaryContext* inDictionary) void CFFANSIFontWriter::WriteSubTypeValue(DictionaryContext* inDictionary)
{ {
inDictionary->WriteNameValue(scType1); inDictionary->WriteNameValue(scType1);
} }
IFontDescriptorHelper* CFFANSIFontWriter::GetCharsetWriter() IFontDescriptorHelper* CFFANSIFontWriter::GetCharsetWriter()
{ {
 End of changes. 8 change blocks. 
47 lines changed or deleted 45 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS