@@ -10,6 +10,7 @@ Elm.Native.Graphics.Text = function(elm) {
10 var htmlHeight = Elm.Native.Utils(elm).htmlHeight;
10 var htmlHeight = Elm.Native.Utils(elm).htmlHeight;
11 var Color = Elm.Native.Graphics.Color(elm);
11 var Color = Elm.Native.Graphics.Color(elm);
12 var Element = Elm.Graphics.Element(elm);
12 var Element = Elm.Graphics.Element(elm);
13+ var show = Elm.Native.Show(elm).show;
14 function makeSpaces(s) {
15 function makeSpaces(s) {
15 if (s.length == 0) { return s; }
16 if (s.length == 0) { return s; }
@@ -66,6 +67,9 @@ Elm.Native.Graphics.Text = function(elm) {
66 function typeface(name, text) {
67 function typeface(name, text) {
67 return addStyle('font-family', JS.fromString(name), text);
68 return addStyle('font-family', JS.fromString(name), text);
70+ function monospace(text) {
71+ return addStyle('font-family', 'monospace', text);
69 function size(px, text) { return addStyle('font-size', px + 'px', text) }
73 function size(px, text) { return addStyle('font-size', px + 'px', text) }
70 var header = addTag('h1');
74 var header = addTag('h1');
71 function height(h, text) { return addStyle('font-size', hf+'em', text) }
75 function height(h, text) { return addStyle('font-size', hf+'em', text) }
@@ -94,7 +98,7 @@ Elm.Native.Graphics.Text = function(elm) {
96 function asText(v) {
100 function asText(v) {
97− return position('left')(typeface('monospace', toText(show(v))));
101+ return position('left')(monospace(toText(show(v))));
100 return elm.Native.Graphics.Text = {
104 return elm.Native.Graphics.Text = {
@@ -107,7 +111,7 @@ Elm.Native.Graphics.Text = function(elm) {
107 underline : underline,
111 underline : underline,
108 overline : overline,
112 overline : overline,
109 strikeThrough : strikeThrough,
113 strikeThrough : strikeThrough,
110− monospace : function(text) { return typeface('monospace', text) },
114+ monospace : monospace,
111 typeface : F2(typeface),
115 typeface : F2(typeface),
112 color : F2(color),
116 color : F2(color),
113 link : F2(link),
117 link : F2(link),