summaryrefslogtreecommitdiff
path: root/fonts/ttmkfdir2/patches/patch-ab
blob: 21274bba1ed9ae142acc37ec01cf25f3106f589c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$NetBSD: patch-ab,v 1.3 2007/11/15 06:36:45 rillig Exp $

--- ttf.cpp.orig	2002-11-07 06:30:04.000000000 +0100
+++ ttf.cpp	2007-11-15 07:05:27.304109000 +0100
@@ -137,7 +137,12 @@ Face::Face (const std::string &filename)
 	/*
 	 * find all the encodings that are based on this cmap.
 	 */
+#if defined(__SUNPRO_CC)
+	/* Error: Cannot use ... ::iterator ... to initialize ... ::const_iterator ... */
+	typedef Encodings_t::iterator MI;
+#else
 	typedef Encodings_t::const_iterator MI;
+#endif
 	std::pair<MI, MI> bounds = Encodings::instance()->equal_range (key);
 
 	/*
@@ -226,7 +231,7 @@ Face::FontFamilyName (void) const
 	for (i = 0; i < n; i++) {
 	    if ((fterror = FT_Get_Sfnt_Name (face, i, &NamePtr)) != FT_Err_Ok) {
                     std::cout << "Warning: Can't SFNT name : " << FileName << "(" << fterror << ")" << std::endl;
-	            return;
+	            return "unknown";
             };
             platform = NamePtr.platform_id;
             encoding = NamePtr.encoding_id;
@@ -522,7 +527,7 @@ Face::Weight (void) const
 {
     const char *result;
     
-    if (cmdline::instance()->option ("panose") && ((result = PanoseWeight ()) != 0)) {
+    if (bool(cmdline::instance()->option ("panose")) && ((result = PanoseWeight ()) != 0)) {
 	return result;
     } else if ((result = OS2Weight ()) != 0) {
 	return result;
@@ -603,7 +608,7 @@ Face::Width (void) const
 {
     const char *result;
     
-    if (cmdline::instance()->option ("panose") && ((result = PanoseWidth ()) != 0)) {
+    if (bool(cmdline::instance()->option ("panose")) && ((result = PanoseWidth ()) != 0)) {
 	return result;
     } else if ((result = OS2Width ()) != 0) {
 	return result;