mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-28 09:13:08 +03:00
Fixed text scaling.
svn path=/trunk/netsurf/; revision=11905
This commit is contained in:
parent
d2626ece45
commit
b73a68edab
@ -113,7 +113,10 @@ void cocoa_set_font_scale_factor( float newFactor )
|
||||
|
||||
void cocoa_draw_string( CGFloat x, CGFloat y, const char *bytes, size_t length, const plot_font_style_t *style )
|
||||
{
|
||||
NSLayoutManager *layout = cocoa_prepare_layout_manager( bytes, length, style );
|
||||
plot_font_style_t actualStyle = *style;
|
||||
actualStyle.size = (CGFloat)actualStyle.size * cocoa_font_scale_factor;
|
||||
|
||||
NSLayoutManager *layout = cocoa_prepare_layout_manager( bytes, length, &actualStyle );
|
||||
if (layout == nil) return;
|
||||
|
||||
NSFont *font = [cocoa_text_storage attribute: NSFontAttributeName atIndex: 0 effectiveRange: NULL];
|
||||
@ -219,7 +222,7 @@ static NSString * const cocoa_font_families[PLOT_FONT_FAMILY_COUNT] = {
|
||||
static inline NSFont *cocoa_font_get_nsfont( const plot_font_style_t *style )
|
||||
{
|
||||
NSFont *font = [NSFont fontWithName: cocoa_font_families[style->family]
|
||||
size: cocoa_font_scale_factor * (CGFloat)style->size / FONT_SIZE_SCALE];
|
||||
size: (CGFloat)style->size / FONT_SIZE_SCALE];
|
||||
|
||||
NSFontTraitMask traits = 0;
|
||||
if (style->flags & FONTF_ITALIC || style->flags & FONTF_OBLIQUE) traits |= NSItalicFontMask;
|
||||
|
Loading…
Reference in New Issue
Block a user