From 9f69106ac42dbcc5b75d58b00edfada7d291fc7c Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 22 Jan 2010 07:40:25 +0000 Subject: Construct font_family from core family name. svn path=/trunk/netsurf/; revision=9863 --- beos/beos_font.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/beos/beos_font.cpp b/beos/beos_font.cpp index c4d5221ff..b3617d1ed 100644 --- a/beos/beos_font.cpp +++ b/beos/beos_font.cpp @@ -353,9 +353,15 @@ void nsbeos_style_to_font(BFont &font, const plot_font_style_t *fstyle) //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); - else { + if (family) { + font_family beos_family; + + strncpy(beos_family, family, B_FONT_FAMILY_NAME_LENGTH); + // Ensure it's terminated + beos_family[B_FONT_FAMILY_NAME_LENGTH] = '\0'; + + font.SetFamilyAndFace(beos_family, face); + } else { //XXX not used font = be_plain_font; font.SetFace(face); -- cgit v1.2.3