r20216 by jghali - #13180: Encoding error in PDF with Symbol font

scribus-commit scribus-commit at lists.scribus.net
Sat Jun 27 13:35:02 UTC 2015


Author: jghali
Date: Sat Jun 27 13:35:02 2015
New Revision: 20216

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20216
Log:
#13180: Encoding error in PDF with Symbol font

Modified:
    branches/Version14x/Scribus/scribus/fonts/scface.cpp
    branches/Version14x/Scribus/scribus/fonts/scface.h
    branches/Version14x/Scribus/scribus/fonts/scface_ttf.cpp
    branches/Version14x/Scribus/scribus/fonts/scface_ttf.h
    branches/Version14x/Scribus/scribus/pdflib_core.cpp

Modified: branches/Version14x/Scribus/scribus/fonts/scface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20216&path=/branches/Version14x/Scribus/scribus/fonts/scface.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/fonts/scface.cpp (original)
+++ branches/Version14x/Scribus/scribus/fonts/scface.cpp Sat Jun 27 13:35:02 2015
@@ -208,6 +208,14 @@
 	return NONE; 
 }
 
+bool ScFace::isSymbolic() const
+{
+	if (m->status == ScFace::UNKNOWN) {
+		m->load();
+	}
+	return m->isSymbolic();
+}
+
 QString ScFace::pdfAscentAsString() const
 {
 	if (m->status == ScFace::UNKNOWN) {

Modified: branches/Version14x/Scribus/scribus/fonts/scface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20216&path=/branches/Version14x/Scribus/scribus/fonts/scface.h
==============================================================================
--- branches/Version14x/Scribus/scribus/fonts/scface.h (original)
+++ branches/Version14x/Scribus/scribus/fonts/scface.h Sat Jun 27 13:35:02 2015
@@ -187,6 +187,7 @@
 		virtual FPointArray glyphOutline(uint gl, qreal sz) const; 
 		virtual FPoint      glyphOrigin (uint gl, qreal sz) const;
 		
+		virtual bool isSymbolic() const { return false; }
 	};
 		
 	
@@ -200,6 +201,9 @@
 
 	/// test for null object
 	bool isNone() const   { return m->status == NULLFACE; }
+
+	/// test if font is a symbolic font
+	bool isSymbolic() const;
 	
 	ScFace& operator=(const ScFace& other);
 	/** two ScFaces are equal if they either are both NULLFACEs or they

Modified: branches/Version14x/Scribus/scribus/fonts/scface_ttf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20216&path=/branches/Version14x/Scribus/scribus/fonts/scface_ttf.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/fonts/scface_ttf.cpp (original)
+++ branches/Version14x/Scribus/scribus/fonts/scface_ttf.cpp Sat Jun 27 13:35:02 2015
@@ -495,6 +495,13 @@
 		delete kernFeature;
 }
 
+bool ScFace_ttf::isSymbolic() const
+{
+	FT_Face face = ftFace();
+	if (!face || !face->charmap)
+		return false;
+	return (m_face->charmap->encoding == FT_ENCODING_MS_SYMBOL);
+}
 
 void ScFace_ttf::load() const
 {

Modified: branches/Version14x/Scribus/scribus/fonts/scface_ttf.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20216&path=/branches/Version14x/Scribus/scribus/fonts/scface_ttf.h
==============================================================================
--- branches/Version14x/Scribus/scribus/fonts/scface_ttf.h (original)
+++ branches/Version14x/Scribus/scribus/fonts/scface_ttf.h Sat Jun 27 13:35:02 2015
@@ -97,6 +97,8 @@
 	void RawData(QByteArray & bb) const;
 
 	qreal glyphKerning ( uint gl1, uint gl2, qreal sz ) const;
+	
+	virtual bool isSymbolic() const;
 
 private:
 	mutable KernFeature * kernFeature;

Modified: branches/Version14x/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20216&path=/branches/Version14x/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/pdflib_core.cpp (original)
+++ branches/Version14x/Scribus/scribus/pdflib_core.cpp Sat Jun 27 13:35:02 2015
@@ -1431,82 +1431,40 @@
 			++nglyphs;
 //			qDebug() << QString("pdflib: nglyphs %1 max %2").arg(nglyphs).arg(face.maxGlyph());
 			uint FontDes = fontDescriptor;
-			uint Fcc = nglyphs / 224;
-			if ((nglyphs % 224) != 0)
-				Fcc += 1;
-			for (uint Fc = 0; Fc < Fcc; ++Fc)
+			if (face.isSymbolic() && (fformat == ScFace::SFNT || fformat == ScFace::TTCF))
 			{
 				uint fontWidths2 = newObject();
 				StartObj(fontWidths2);
-				int chCount = 32;
-				PutDoc("[ 0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 ");
-				for (int ww = 32; ww < 256; ++ww)
-				{
-					uint glyph = 224 * Fc + ww - 32;
-					if (gl.contains(glyph))
-						PutDoc(QString::number(static_cast<int>(face.glyphWidth(glyph)* 1000))+" ");
-					else
-						PutDoc("0 ");
-					chCount++;
-					if (signed(glyph) == nglyphs-1)
-						break;
-				}
-				PutDoc("]\nendobj\n");
-				uint fontEncoding2 = newObject();
-				StartObj(fontEncoding2);
 				QStringList toUnicodeMaps;
 				QList<int> toUnicodeMapsCount;
 				QString toUnicodeMap = "";
 				int toUnicodeMapCounter = 0;
-				PutDoc("<< /Type /Encoding\n");
-				PutDoc("/Differences [ \n");
-				int crc = 0;
-				bool startOfSeq = true;
-				for (int ww2 = 32; ww2 < 256; ++ww2)
-				{
-					uint glyph = 224 * Fc + ww2 - 32;
-					QMap<uint,std::pair<QChar,QString> >::Iterator glIt = gl.find(glyph);
-					if (glIt != gl.end() && !glIt.value().second.isEmpty())
+
+				PutDoc("[ ");
+				QList<uint> keys = gl.uniqueKeys();
+				QList<uint>::iterator git;
+				for (git = keys.begin(); git != keys.end(); ++git)
+				{
+					PutDoc(QString::number(*git)+" ["+QString::number(static_cast<int>(face.glyphWidth(*git)* 1000))+"] " );
+					QString tmp, tmp2;
+					tmp.sprintf("%04X", *git);
+					tmp2.sprintf("%04X", gl.value(*git).first.unicode());
+					toUnicodeMap += QString("<%1> <%2>\n").arg(tmp).arg((tmp2));
+					toUnicodeMapCounter++;
+					if (toUnicodeMapCounter == 100)
 					{
-						if (startOfSeq)
-						{
-							PutDoc(QString::number(ww2)+" ");
-							startOfSeq = false;
-						}
-						PutDoc("/"+glIt.value().second+" ");
-						QString tmp, tmp2;
-						tmp.sprintf("%02X", ww2);
-						tmp2.sprintf("%04X", glIt.value().first.unicode());
-						toUnicodeMap += QString("<%1> <%2>\n").arg(tmp).arg((tmp2));
-						toUnicodeMapCounter++;
-						if (toUnicodeMapCounter == 100)
-						{
-							toUnicodeMaps.append(toUnicodeMap);
-							toUnicodeMapsCount.append(toUnicodeMapCounter);
-							toUnicodeMap = "";
-							toUnicodeMapCounter = 0;
-						}
-						crc++;
+						toUnicodeMaps.append(toUnicodeMap);
+						toUnicodeMapsCount.append(toUnicodeMapCounter);
+						toUnicodeMap = "";
+						toUnicodeMapCounter = 0;
 					}
-					else
-					{
-						startOfSeq = true;
-					}
-					if (signed(glyph) == nglyphs-1)
-						break;
-					if (crc > 8)
-					{
-						PutDoc("\n");
-						crc = 0;
-					}
-				}
+				}
+				PutDoc("]\nendobj\n");
 				if (toUnicodeMapCounter != 0)
 				{
 					toUnicodeMaps.append(toUnicodeMap);
 					toUnicodeMapsCount.append(toUnicodeMapCounter);
 				}
-				PutDoc("]\n");
-				PutDoc(">>\nendobj\n");
 				QString toUnicodeMapStream = "";
 				toUnicodeMapStream += "/CIDInit /ProcSet findresource begin\n";
 				toUnicodeMapStream += "12 dict begin\n";
@@ -1534,68 +1492,193 @@
 				uint fontToUnicode2 = WritePDFStream(toUnicodeMapStream);
 				uint fontObject2 = newObject();
 				StartObj(fontObject2);
+				PutDoc("<<\n/Type /Font\n/Subtype /Type0\n");
+				PutDoc("/Name /Fo"+QString::number(a)+"\n");
+				PutDoc("/BaseFont /"+face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+"\n");
+				PutDoc("/Encoding /Identity-H\n");
+				PutDoc("/ToUnicode "+QString::number(fontToUnicode2)+" 0 R\n");
+				PutDoc("/DescendantFonts [");
+				PutDoc("<</Type /Font");
+				PutDoc("/Subtype /CIDFontType2");
+				PutDoc("/BaseFont /"+face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ));
+				PutDoc("/FontDescriptor "+QString::number(FontDes)+" 0 R");
+				PutDoc("/CIDSystemInfo <</Ordering(Identity)/Registry(Adobe)/Supplement 0>>");
+				PutDoc("/DW 1000");
+				PutDoc("/W "+QString::number(fontWidths2)+" 0 R");
+				PutDoc("/CIDToGIDMap /Identity");
+				PutDoc(">>"); // close CIDFont dictionary
+				PutDoc("]\n"); // close DescendantFonts array
+				PutDoc(">>\nendobj\n");
+				Seite.FObjects["Fo"+QString::number(a)] = fontObject2;
+			}
+			else
+			{
+				uint Fcc = nglyphs / 224;
+				if ((nglyphs % 224) != 0)
+					Fcc += 1;
+				for (uint Fc = 0; Fc < Fcc; ++Fc)
+				{
+					uint fontWidths2 = newObject();
+					StartObj(fontWidths2);
+					int chCount = 32;
+					PutDoc("[ 0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 ");
+					for (int ww = 32; ww < 256; ++ww)
+					{
+						uint glyph = 224 * Fc + ww - 32;
+						if (gl.contains(glyph))
+							PutDoc(QString::number(static_cast<int>(face.glyphWidth(glyph)* 1000))+" ");
+						else
+							PutDoc("0 ");
+						chCount++;
+						if (signed(glyph) == nglyphs-1)
+							break;
+					}
+					PutDoc("]\nendobj\n");
+					uint fontEncoding2 = newObject();
+					StartObj(fontEncoding2);
+					QStringList toUnicodeMaps;
+					QList<int> toUnicodeMapsCount;
+					QString toUnicodeMap = "";
+					int toUnicodeMapCounter = 0;
+					PutDoc("<< /Type /Encoding\n");
+					PutDoc("/Differences [ \n");
+					int crc = 0;
+					bool startOfSeq = true;
+					for (int ww2 = 32; ww2 < 256; ++ww2)
+					{
+						uint glyph = 224 * Fc + ww2 - 32;
+						QMap<uint,std::pair<QChar,QString> >::Iterator glIt = gl.find(glyph);
+						if (glIt != gl.end() && !glIt.value().second.isEmpty())
+						{
+							if (startOfSeq)
+							{
+								PutDoc(QString::number(ww2)+" ");
+								startOfSeq = false;
+							}
+							PutDoc("/"+glIt.value().second+" ");
+							QString tmp, tmp2;
+							tmp.sprintf("%02X", ww2);
+							tmp2.sprintf("%04X", glIt.value().first.unicode());
+							toUnicodeMap += QString("<%1> <%2>\n").arg(tmp).arg((tmp2));
+							toUnicodeMapCounter++;
+							if (toUnicodeMapCounter == 100)
+							{
+								toUnicodeMaps.append(toUnicodeMap);
+								toUnicodeMapsCount.append(toUnicodeMapCounter);
+								toUnicodeMap = "";
+								toUnicodeMapCounter = 0;
+							}
+							crc++;
+						}
+						else
+						{
+							startOfSeq = true;
+						}
+						if (signed(glyph) == nglyphs-1)
+							break;
+						if (crc > 8)
+						{
+							PutDoc("\n");
+							crc = 0;
+						}
+					}
+					if (toUnicodeMapCounter != 0)
+					{
+						toUnicodeMaps.append(toUnicodeMap);
+						toUnicodeMapsCount.append(toUnicodeMapCounter);
+					}
+					PutDoc("]\n");
+					PutDoc(">>\nendobj\n");
+					QString toUnicodeMapStream = "";
+					toUnicodeMapStream += "/CIDInit /ProcSet findresource begin\n";
+					toUnicodeMapStream += "12 dict begin\n";
+					toUnicodeMapStream += "begincmap\n";
+					toUnicodeMapStream += "/CIDSystemInfo <<\n";
+					toUnicodeMapStream += "/Registry (Adobe)\n";
+					toUnicodeMapStream += "/Ordering (UCS)\n";
+					toUnicodeMapStream += "/Supplement 0\n";
+					toUnicodeMapStream += ">> def\n";
+					toUnicodeMapStream += "/CMapName /Adobe-Identity-UCS def\n";
+					toUnicodeMapStream += "/CMapType 2 def\n";
+					toUnicodeMapStream += "1 begincodespacerange\n";
+					toUnicodeMapStream += "<0000> <FFFF>\n";
+					toUnicodeMapStream += "endcodespacerange\n";
+					for (int uniC = 0; uniC < toUnicodeMaps.count(); uniC++)
+					{
+						toUnicodeMapStream += QString("%1 beginbfchar\n").arg(toUnicodeMapsCount[uniC]);
+						toUnicodeMapStream += toUnicodeMaps[uniC];
+						toUnicodeMapStream += "endbfchar\n";
+					}
+					toUnicodeMapStream += "endcmap\n";
+					toUnicodeMapStream += "CMapName currentdict /CMap defineresource pop\n";
+					toUnicodeMapStream += "end\n";
+					toUnicodeMapStream += "end\n";
+					uint fontToUnicode2 = WritePDFStream(toUnicodeMapStream);
+					uint fontObject2 = newObject();
+					StartObj(fontObject2);
+					PutDoc("<<\n/Type /Font\n/Subtype ");
+					PutDoc((fformat == ScFace::SFNT || fformat == ScFace::TTCF) ? "/TrueType\n" : "/Type1\n");
+					PutDoc("/Name /Fo"+QString::number(a)+"S"+QString::number(Fc)+"\n");
+					PutDoc("/BaseFont /"+face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+"\n");
+					PutDoc("/FirstChar 0\n");
+					PutDoc("/LastChar "+QString::number(chCount-1)+"\n");
+					PutDoc("/Widths "+QString::number(fontWidths2)+" 0 R\n");
+					PutDoc("/Encoding "+QString::number(fontEncoding2)+" 0 R\n");
+					PutDoc("/ToUnicode "+QString::number(fontToUnicode2)+" 0 R\n");
+					PutDoc("/FontDescriptor "+QString::number(FontDes)+" 0 R\n");
+					PutDoc(">>\nendobj\n");
+					Seite.FObjects["Fo"+QString::number(a)+"S"+QString::number(Fc)] = fontObject2;
+				} // for(Fc)
+				uint fontWidthsForm = newObject();
+				StartObj(fontWidthsForm);
+				PutDoc("[ 0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 ");
+				for (int ww = 32; ww < 256; ++ww)
+				{
+					uint glyph = face.char2CMap(QChar(ww));
+					if (gl.contains(glyph))
+						PutDoc(QString::number(static_cast<int>(face.glyphWidth(glyph)* 1000))+" ");
+					else
+						PutDoc("0 ");
+				}
+				PutDoc("]\nendobj\n");
+				uint fontObjectForm = newObject();
+				StartObj(fontObjectForm);
 				PutDoc("<<\n/Type /Font\n/Subtype ");
 				PutDoc((fformat == ScFace::SFNT || fformat == ScFace::TTCF) ? "/TrueType\n" : "/Type1\n");
-				PutDoc("/Name /Fo"+QString::number(a)+"S"+QString::number(Fc)+"\n");
+	//			if (fformat == ScFace::SFNT || fformat == ScFace::TTCF)
+	//			{
+	//				PutDoc("/TrueType\n");
+					PutDoc("/Name /Fo"+QString::number(a)+"Form"+"\n");
+					Seite.FObjects["Fo"+QString::number(a)+"Form"] = fontObjectForm;
+					UsedFontsF.insert(it.key(), "/Fo"+QString::number(a)+"Form");
+	/*			}
+				else
+				{
+					PutDoc("/Type1\n");
+					PutDoc("/Name /"+face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+"\n");
+					Seite.FObjects[face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )] = ObjCounter;
+					UsedFontsF.insert(it.key(), "/"+face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ));
+				} */
 				PutDoc("/BaseFont /"+face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+"\n");
+				PutDoc("/Encoding << \n");
+				PutDoc("/Differences [ \n");
+				PutDoc("24 /breve /caron /circumflex /dotaccent /hungarumlaut /ogonek /ring /tilde\n");
+				PutDoc("39 /quotesingle 96 /grave 128 /bullet /dagger /daggerdbl /ellipsis /emdash /endash /florin /fraction /guilsinglleft /guilsinglright\n");
+				PutDoc("/minus /perthousand /quotedblbase /quotedblleft /quotedblright /quoteleft /quoteright /quotesinglbase /trademark /fi /fl /Lslash /OE /Scaron\n");
+				PutDoc("/Ydieresis /Zcaron /dotlessi /lslash /oe /scaron /zcaron 164 /currency 166 /brokenbar 168 /dieresis /copyright /ordfeminine 172 /logicalnot\n");
+				PutDoc("/.notdef /registered /macron /degree /plusminus /twosuperior /threesuperior /acute /mu 183 /periodcentered /cedilla /onesuperior /ordmasculine\n");
+				PutDoc("188 /onequarter /onehalf /threequarters 192 /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex\n");
+				PutDoc("/Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash\n");
+				PutDoc("/Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla\n");
+				PutDoc("/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis\n");
+				PutDoc("/divide /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis\n");
+				PutDoc("] >>\n");
 				PutDoc("/FirstChar 0\n");
-				PutDoc("/LastChar "+QString::number(chCount-1)+"\n");
-				PutDoc("/Widths "+QString::number(fontWidths2)+" 0 R\n");
-				PutDoc("/Encoding "+QString::number(fontEncoding2)+" 0 R\n");
-				PutDoc("/ToUnicode "+QString::number(fontToUnicode2)+" 0 R\n");
+				PutDoc("/LastChar 255\n");
+				PutDoc("/Widths "+QString::number(fontWidthsForm)+" 0 R\n");
 				PutDoc("/FontDescriptor "+QString::number(FontDes)+" 0 R\n");
 				PutDoc(">>\nendobj\n");
-				Seite.FObjects["Fo"+QString::number(a)+"S"+QString::number(Fc)] = fontObject2;
-			} // for(Fc)
-			uint fontWidthsForm = newObject();
-			StartObj(fontWidthsForm);
-			PutDoc("[ 0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 ");
-			for (int ww = 32; ww < 256; ++ww)
-			{
-				uint glyph = face.char2CMap(QChar(ww));
-				if (gl.contains(glyph))
-					PutDoc(QString::number(static_cast<int>(face.glyphWidth(glyph)* 1000))+" ");
-				else
-					PutDoc("0 ");
-			}
-			PutDoc("]\nendobj\n");
-			uint fontObjectForm = newObject();
-			StartObj(fontObjectForm);
-			PutDoc("<<\n/Type /Font\n/Subtype ");
-			PutDoc((fformat == ScFace::SFNT || fformat == ScFace::TTCF) ? "/TrueType\n" : "/Type1\n");
-//			if (fformat == ScFace::SFNT || fformat == ScFace::TTCF)
-//			{
-//				PutDoc("/TrueType\n");
-				PutDoc("/Name /Fo"+QString::number(a)+"Form"+"\n");
-				Seite.FObjects["Fo"+QString::number(a)+"Form"] = fontObjectForm;
-				UsedFontsF.insert(it.key(), "/Fo"+QString::number(a)+"Form");
-/*			}
-			else
-			{
-				PutDoc("/Type1\n");
-				PutDoc("/Name /"+face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+"\n");
-				Seite.FObjects[face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )] = ObjCounter;
-				UsedFontsF.insert(it.key(), "/"+face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" ));
-			} */
-			PutDoc("/BaseFont /"+face.psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+"\n");
-			PutDoc("/Encoding << \n");
-			PutDoc("/Differences [ \n");
-			PutDoc("24 /breve /caron /circumflex /dotaccent /hungarumlaut /ogonek /ring /tilde\n");
-			PutDoc("39 /quotesingle 96 /grave 128 /bullet /dagger /daggerdbl /ellipsis /emdash /endash /florin /fraction /guilsinglleft /guilsinglright\n");
-			PutDoc("/minus /perthousand /quotedblbase /quotedblleft /quotedblright /quoteleft /quoteright /quotesinglbase /trademark /fi /fl /Lslash /OE /Scaron\n");
-			PutDoc("/Ydieresis /Zcaron /dotlessi /lslash /oe /scaron /zcaron 164 /currency 166 /brokenbar 168 /dieresis /copyright /ordfeminine 172 /logicalnot\n");
-			PutDoc("/.notdef /registered /macron /degree /plusminus /twosuperior /threesuperior /acute /mu 183 /periodcentered /cedilla /onesuperior /ordmasculine\n");
-			PutDoc("188 /onequarter /onehalf /threequarters 192 /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex\n");
-			PutDoc("/Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash\n");
-			PutDoc("/Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla\n");
-			PutDoc("/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis\n");
-			PutDoc("/divide /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis\n");
-			PutDoc("] >>\n");
-			PutDoc("/FirstChar 0\n");
-			PutDoc("/LastChar 255\n");
-			PutDoc("/Widths "+QString::number(fontWidthsForm)+" 0 R\n");
-			PutDoc("/FontDescriptor "+QString::number(FontDes)+" 0 R\n");
-			PutDoc(">>\nendobj\n");
+			}
 		}
 		a++;
 	}
@@ -4695,7 +4778,11 @@
 					idx1 = Type3Fonts[UsedFontsP[style.font().replacementName()]][idx] / 256;
 				else
 					idx1 = idx / 224;
-				tmp += UsedFontsP[style.font().replacementName()]+"S"+QString::number(idx1)+" "+FToStr(tsz / 10.0)+" Tf\n";
+				ScFace currentFace = style.font();
+				if (currentFace.isSymbolic() && (currentFace.format() == ScFace::SFNT || currentFace.format() == ScFace::TTCF))
+					tmp += UsedFontsP[currentFace.replacementName()]+" "+FToStr(tsz / 10.0)+" Tf\n";
+				else
+					tmp += UsedFontsP[currentFace.replacementName()]+"S"+QString::number(idx1)+" "+FToStr(tsz / 10.0)+" Tf\n";
 				if (style.strokeColor() != CommonStrings::None)
 					tmp += StrokeColor;
 				if (style.fillColor() != CommonStrings::None)
@@ -4801,6 +4888,15 @@
 						idx2 = Type3Fonts[UsedFontsP[style.font().replacementName()]][idx] % 256;
 						tmp += "<"+QString(toHex(idx2))+"> Tj\n";
 					}
+				}
+				else if (currentFace.isSymbolic() && (currentFace.format() == ScFace::SFNT || currentFace.format() == ScFace::TTCF))
+				{
+					QString val;
+					val.setNum(idx, 16);
+					int numberOfZero = 4 - val.size();
+					for (int i=0; i<numberOfZero; ++i)
+						val.prepend("0");
+					tmp += "<"+val+"> Tj\n";
 				}
 				else
 				{




More information about the scribus-commit mailing list