Package: gem / 1:0.93.3-7

text_linebreak.patch Patch series | download
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Author: IOhannes m zmölnig
Description: fixed lineBreak algorithm for text-objects
 allow CR at the beginning of the string
 removed the c-style casts to "signed long", when we know that
 std::wstring::find() always returns "size_t"
--- gem.orig/src/Base/TextBase.cpp
+++ gem/src/Base/TextBase.cpp
@@ -16,7 +16,7 @@
 /////////////////////////////////////////////////////////
 
 /*
- * FIXXME: check how font handling behaves with multiple contexts 
+ * FIXXME: check how font handling behaves with multiple contexts
  */
 
 #include "TextBase.h"
@@ -48,7 +48,7 @@
 TextBase :: TextBase(int argc, t_atom *argv)
   :
   m_dist(1), m_valid(0), m_fontSize(20), m_fontDepth(20), m_precision(1.f),
-  m_widthJus(CENTER), m_heightJus(MIDDLE), m_depthJus(HALFWAY), 
+  m_widthJus(CENTER), m_heightJus(MIDDLE), m_depthJus(HALFWAY),
   m_inlet(NULL),
   m_font(NULL), m_fontname(NULL)
 {
@@ -287,7 +287,7 @@
     height = y_offset;
   else if (m_heightJus == TOP)   height = ascender + y_offset;
   else if (m_heightJus == MIDDLE)height = (ascender/2.f) + y_offset;
-    
+
   if (m_depthJus == FRONT)       depth = z1;
   else if (m_depthJus == BACK)   depth = z2-z1;
   else if (m_depthJus == HALFWAY)depth = z2 / 2.f;
@@ -313,7 +313,7 @@
     m_theText.push_back(line.substr(0,pos));
     line=line.erase(0,pos+1);
   }
-  
+
   // if there is still a text append it
   if(line.length())
     m_theText.push_back(line);
@@ -428,7 +428,7 @@
   m_lineDist.clear();
   if (m_heightJus == BOTTOM || m_heightJus == BASEH)
     {
-      // so the offset will be a simple 
+      // so the offset will be a simple
       // [0 1 2 3 ... n] sequence
       for(i=0; i<m_theText.size(); i++)
         m_lineDist.push_back(i);
@@ -483,7 +483,7 @@
 
   for (i = 0; i < argc; i++)    {
     int v=atom_getint(argv+i);
-    /* 
+    /*
      * i experienced crashes in FTGL with indices>65535;
      * since TrueType fonts cannot hold more than 65536 entries
      * we just clamp it...
@@ -550,7 +550,7 @@
   JustifyHeight hType=MIDDLE;
   JustifyDepth  dType=HALFWAY;
   char c;
-  
+
   switch(argc){
   case 3:
     c=atom_getsymbol(argv+2)->s_name[2];
@@ -560,11 +560,11 @@
     case 's': case 'S': dType = BASED; break;
     case 'l': case 'L': case 'n': case 'N': dType = HALFWAY; break;
     default:
-      GetMyClass(data)->error("invalid depth justification: %s (must be: front|back|halfway|base)", 
+      GetMyClass(data)->error("invalid depth justification: %s (must be: front|back|halfway|base)",
 	    atom_getsymbol(argv+2)->s_name);
       return;
     }
-  case 2:    
+  case 2:
     c=atom_getsymbol(argv+1)->s_name[2];
     switch (c){
     case 't': case 'T': hType = BOTTOM; break;
@@ -572,7 +572,7 @@
     case 'd': case 'D': case 'n': case 'N': hType = MIDDLE; break;
     case 's': case 'S': hType = BASEH; break;
     default:
-      GetMyClass(data)->error("invalid height justification: %s (must be bottom|top|middle|base)", 
+      GetMyClass(data)->error("invalid height justification: %s (must be bottom|top|middle|base)",
 	    atom_getsymbol(argv+1)->s_name);
       return;
     }
@@ -593,7 +593,7 @@
     GetMyClass(data)->error("justification most be \"width [height [depth]]\"");
     return;
   }
-  
+
   switch(argc){
   case 1: GetMyClass(data)->setJustification(wType); break;
   case 2: GetMyClass(data)->setJustification(wType, hType); break;