summaryrefslogtreecommitdiff
path: root/beos/beos_font.cpp
diff options
context:
space:
mode:
authorFrançois Revel <mmu_man@netsurf-browser.org>2008-10-10 21:43:25 +0000
committerFrançois Revel <mmu_man@netsurf-browser.org>2008-10-10 21:43:25 +0000
commit4e79ee3d071df821f51f1a3f2d09bfedaa7af3b1 (patch)
tree75956bc92b844280da04395b9d80f2c4e6b324c7 /beos/beos_font.cpp
parente4fba7f577d44f3235b2c430191d96ddfc084827 (diff)
downloadnetsurf-4e79ee3d071df821f51f1a3f2d09bfedaa7af3b1.tar.gz
netsurf-4e79ee3d071df821f51f1a3f2d09bfedaa7af3b1.tar.bz2
- support BITMAP_CLEAR_MEMORY in create_bitmap()
- copying to clipboard now constructs a text_run_array for StyledEdit, that is added to the clipboard. In applications supporting it it pastes the text with the correct fonts and sizes, and the text colors. - tried to find which line in source code the selection starts to open the editor there, but it's not finished so it's disabled. svn path=/trunk/netsurf/; revision=5533
Diffstat (limited to 'beos/beos_font.cpp')
-rw-r--r--beos/beos_font.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/beos/beos_font.cpp b/beos/beos_font.cpp
index 15b865ea8..9f7ed34f9 100644
--- a/beos/beos_font.cpp
+++ b/beos/beos_font.cpp
@@ -42,8 +42,6 @@ extern "C" {
#include "beos/beos_font.h"
#include "beos/beos_plotters.h"
-static void nsfont_style_to_font(BFont &font,
- const struct css_style *style);
static bool nsfont_width(const struct css_style *style,
const char *string, size_t length,
int *width);
@@ -84,7 +82,7 @@ bool nsfont_width(const struct css_style *style,
return true;
}
- nsfont_style_to_font(font, style);
+ nsbeos_style_to_font(font, style);
*width = (int)font.StringWidth(string, length);
return true;
}
@@ -134,7 +132,7 @@ bool nsfont_position_in_string(const struct css_style *style,
int index;
BFont font;
- nsfont_style_to_font(font, style);
+ nsbeos_style_to_font(font, style);
BString str(string);
int32 len = str.CountChars();
float escapements[len];
@@ -184,7 +182,7 @@ bool nsfont_split(const struct css_style *style,
int index = 0;
BFont font;
- nsfont_style_to_font(font, style);
+ nsbeos_style_to_font(font, style);
BString str(string);
int32 len = str.CountChars();
float escapements[len];
@@ -245,7 +243,7 @@ bool nsfont_paint(const struct css_style *style,
if (length == 0)
return true;
- nsfont_style_to_font(font, style);
+ nsbeos_style_to_font(font, style);
background = nsbeos_rgb_colour(bg);
foreground = nsbeos_rgb_colour(c);
@@ -296,7 +294,7 @@ bool nsfont_paint(const struct css_style *style,
* \return a new Pango font description
*/
-static void nsfont_style_to_font(BFont &font,
+void nsbeos_style_to_font(BFont &font,
const struct css_style *style)
{
float size;
@@ -378,7 +376,7 @@ static void nsfont_style_to_font(BFont &font,
if (!face)
face = B_REGULAR_FACE;
-//fprintf(stderr, "nsfont_style_to_font: %d, %d, %d -> '%s' %04x\n", style->font_family, style->font_style, style->font_weight, family, face);
+//fprintf(stderr, "nsbeos_style_to_font: %d, %d, %d -> '%s' %04x\n", style->font_family, style->font_style, style->font_weight, family, face);
if (family)
font.SetFamilyAndFace((const font_family)family, face);
@@ -388,7 +386,7 @@ static void nsfont_style_to_font(BFont &font,
font.SetFace(face);
}
-//fprintf(stderr, "nsfont_style_to_font: value %f unit %d\n", style->font_size.value.length.value, style->font_size.value.length.unit);
+//fprintf(stderr, "nsbeos_style_to_font: value %f unit %d\n", style->font_size.value.length.value, style->font_size.value.length.unit);
if (style->font_size.value.length.unit == CSS_UNIT_PT)
size = style->font_size.value.length.value;
else
@@ -399,7 +397,7 @@ static void nsfont_style_to_font(BFont &font,
if (size < abs(option_font_min_size / 10))
size = option_font_min_size / 10;
-//fprintf(stderr, "nsfont_style_to_font: %f %d\n", size, style->font_size.value.length.unit);
+//fprintf(stderr, "nsbeos_style_to_font: %f %d\n", size, style->font_size.value.length.unit);
font.SetSize(size);
}