26#define __STDBOOL_H__ 1
88 if (fstyle->
weight >= 600) {
92 if (fstyle->
weight >= 600) {
97 }
else if (fstyle->
weight <= 300) {
114 face = B_REGULAR_FACE;
119 font_family beos_family;
121 strncpy(beos_family, family, B_FONT_FAMILY_LENGTH);
123 beos_family[B_FONT_FAMILY_LENGTH] =
'\0';
125 font.SetFamilyAndFace(beos_family, face);
128 font = be_plain_font;
151 const char *
string,
size_t length,
163 *
width = (int)font.StringWidth(
string, length);
178 if ((*p & 0x80) == 0)
180 if ((*p & 0xC0) == 0x80)
182 for (i = 2; i < 5; i++) {
204 const char *
string,
size_t length,
205 int x,
size_t *char_offset,
int *actual_x)
207 NSLOG(netsurf, DEEPDEBUG,
"(, '%s', %d, %d, , )",
string, length, x);
214 int32 len = str.CountChars();
215 float escapements[len];
221 font.GetEscapements(
string, len, escapements);
223 for (i = 0;
string[index] && i < len; i++) {
224 esc += escapements[i];
225 current = font.Size() * esc;
231 *actual_x = (int)current;
261 const char *
string,
size_t length,
262 int x,
size_t *char_offset,
int *actual_x)
264 NSLOG(netsurf, DEEPDEBUG,
"(, '%s', %d, %d, , )",
string, length, x);
270 int32 len = str.CountChars();
271 float escapements[len];
278 font.GetEscapements(
string, len, escapements);
280 for (i = 0;
string[index] && i < len; i++) {
281 if (
string[index] ==
' ') {
285 if (x < current && last_space != 0) {
286 *actual_x = (int)last_x;
287 *char_offset = last_space;
290 esc += escapements[i];
291 current = font.Size() * esc;
294 *actual_x =
MIN(*actual_x, (
int)current);
295 *char_offset = index;
313 const char *
string,
size_t length,
320 rgb_color background;
321 rgb_color foreground;
338 oldbg =
view->LowColor();
339 drawing_mode oldmode =
view->DrawingMode();
340 view->SetLowColor(B_TRANSPARENT_32_BIT);
345 size = (float)font.Size();
346#warning XXX use scale
348 view->SetFont(&font);
349 view->SetHighColor(foreground);
350 view->SetDrawingMode(B_OP_OVER);
352 BString
line(
string, length);
354 BPoint where(x, y + 1);
355 view->DrawString(
line.String(), where);
357 view->SetDrawingMode(oldmode);
358 if (memcmp(&oldbg, &background,
sizeof(rgb_color)))
359 view->SetLowColor(oldbg);
static struct s_view view
nserror
Enumeration of error codes.
static nserror beos_font_position(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x)
Find the position in a string where an x coordinate falls.
void nsbeos_style_to_font(BFont &font, const struct plot_font_style *fstyle)
Convert a font style to a PangoFontDescription.
static nserror beos_font_split(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x)
Find where to split a string to make it fit a width.
static nserror beos_font_width(const plot_font_style_t *fstyle, const char *string, size_t length, int *width)
Measure the width of a string.
static int utf8_char_len(const char *c)
struct gui_layout_table * beos_layout_table
static struct gui_layout_table layout_table
bool nsfont_paint(const plot_font_style_t *fstyle, const char *string, size_t length, int x, int y)
Render a string.
Beos font layout handling interface.
Target independent plotting (BeOS interface).
nserror beos_warn_user(const char *warning, const char *detail)
Display a warning for a serious problem (eg memory exhaustion).
Interface to platform-specific layout operation table.
#define NSLOG(catname, level, logmsg, args...)
NetSurf URL handling (interface).
@ PLOT_FONT_FAMILY_CURSIVE
@ PLOT_FONT_FAMILY_SANS_SERIF
@ PLOT_FONT_FAMILY_FANTASY
@ PLOT_FONT_FAMILY_MONOSPACE
#define PLOT_STYLE_SCALE
Scaling factor for plot styles.
rgb_color nsbeos_rgb_colour(colour c)
BView * nsbeos_current_gc(void)
plot_font_generic_family_t family
Generic family to plot with.
colour foreground
Colour of text.
plot_font_flags_t flags
Font flags.
plot_style_fixed size
Font size, in pt.
colour background
Background colour to blend to, if appropriate.
int weight
Font weight: value in range [100,900] as per CSS.
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
Interface to a number of general purpose functionality.
static nserror line(const struct redraw_context *ctx, const plot_style_t *style, const struct rect *line)
Plots a line.