summaryrefslogtreecommitdiffstats
path: root/graphics/wings/files/patch-src_wings__text.erl
blob: 5eb484549f72523f74839ec464b92da2374be9a2 (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
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
--- src/wings_text.erl.orig
+++ src/wings_text.erl
@@ -65,7 +65,7 @@
 
 bold_string_width([C|S], W) ->
     BCW = case wings_font_table:bold_char_width(C) of
-        undefined -> (current_font()):bold_char_width(C);
+        undefined -> wings__font:bold_char_width(current_font(), C);
         Other -> Other
     end,
     bold_string_width(S, BCW+W);
@@ -74,19 +74,19 @@
 
 char_width(C) ->
     case wings_font_table:char_width(C) of
-        undefined -> (current_font()):char_width(C);
+        undefined -> wings__font:char_width(current_font(), C);
         Other -> Other
     end.
 
 width() ->
     case wings_font_table:char(char_width) of
-        undefined -> (current_font()):width();
+        undefined -> wings__font:width(current_font());
         Other -> Other
     end.
 
 height() ->
     case wings_font_table:char(char_height) of
-        undefined -> (current_font()):height();
+        undefined -> wings__font:height(current_font());
         Other -> Other
     end.
 
@@ -111,13 +111,13 @@
 char(C) when is_atom(C) -> special(C);
 char(C) ->
     case wings_font_table:char(C) of
-        undefined -> (current_font()):char(C);
+        undefined -> wings__font:char(current_font(), C);
         Other -> Other
     end.
 
 bold([C|S]) ->
     case wings_font_table:bold_char(C) of
-        undefined -> (current_font()):bold_char(C);
+        undefined -> wings__font:bold_char(current_font(), C);
         Other -> Other
     end,
     bold(S);
@@ -195,7 +195,7 @@
     CharWidth = wings_text:width([$\s])*2,
     Line = [$\s,$\s|Line0],
     string_to_text_box(Tb#tb{text=Text,lw=LW+CharWidth,line=Line});
-    
+
 string_to_text_box(#tb{text=[{Style,String}=Stylized|Text],lw=Lw, max=Max, line=Line0,res=Res}=Tb0) ->
     Sw = width([Stylized]),
     NLW = Lw + Sw,
@@ -504,8 +504,8 @@
     {ok,Bin} = file:read_file(FontDir),
     Font = binary_to_term(Bin),
     Mod = load_font_1(Font),
-    Key = Mod:key(),
-    Desc = Mod:desc(),
+    Key = wings__font:key(Mod),
+    Desc = wings__font:desc(Mod),
     ets:insert(wings_fonts, {Key,Mod,Desc}).
 
 load_font_1({wings_font,?wings_version,Font}) ->
OpenPOWER on IntegriCloud