summaryrefslogtreecommitdiff
path: root/render/textplain.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-07-23 23:05:34 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-07-23 23:05:34 +0000
commitddeadd1c02880367ad786b113d352a519f45ec73 (patch)
tree00b8b46ee1a3fc84e5492c2183dfaa8192d261f9 /render/textplain.c
parentb20949a35025b23da1bf0ac6003f4575eb94281d (diff)
downloadnetsurf-ddeadd1c02880367ad786b113d352a519f45ec73.tar.gz
netsurf-ddeadd1c02880367ad786b113d352a519f45ec73.tar.bz2
Merge LibCSS port to trunk.
svn path=/trunk/netsurf/; revision=8752
Diffstat (limited to 'render/textplain.c')
-rw-r--r--render/textplain.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/render/textplain.c b/render/textplain.c
index dd3d168f9..256d9b8db 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -30,6 +30,7 @@
#include <iconv.h>
#include "content/content.h"
#include "css/css.h"
+#include "css/utils.h"
#include "desktop/gui.h"
#include "desktop/plotters.h"
#include "desktop/selection.h"
@@ -51,7 +52,7 @@
static plot_font_style_t textplain_style = {
.family = PLOT_FONT_FAMILY_MONOSPACE,
- .size = 10,
+ .size = 10 * FONT_SIZE_SCALE,
.weight = 400,
.flags = FONTF_NONE,
.background = 0xffffff,
@@ -69,7 +70,8 @@ static float textplain_line_height(void);
* Create a CONTENT_TEXTPLAIN.
*/
-bool textplain_create(struct content *c, const char *params[])
+bool textplain_create(struct content *c, struct content *parent,
+ const char *params[])
{
unsigned int i;
char *utf8_data;
@@ -733,6 +735,7 @@ float textplain_line_height(void)
/* Size is in points, so convert to pixels.
* Then use a constant line height of 1.2 x font size.
*/
- return (textplain_style.size * css_screen_dpi / 72) * 1.2;
+ return FIXTOFLT(FDIVI((FMUL(FLTTOFIX(1.2),
+ FMULI(nscss_screen_dpi, textplain_style.size))), 72));
}