diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-07-08 20:27:14 +0200 |
---|---|---|
committer | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-07-08 20:27:14 +0200 |
commit | 9fdca96f8bd2211a99fe88e57b70cbecefa20b6d (patch) | |
tree | 6b5d9b4310eb550c83fba23303bbbc77868af1a5 /indra/llrender/llfontfreetypesvg.cpp | |
parent | 9ddf64c65183960ffed4fe61c5d85e8bacaea030 (diff) |
Re-enable compiler warnings C4244 and C4396 except for lltracerecording.h and llunittype.h for now
Diffstat (limited to 'indra/llrender/llfontfreetypesvg.cpp')
-rw-r--r-- | indra/llrender/llfontfreetypesvg.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/indra/llrender/llfontfreetypesvg.cpp b/indra/llrender/llfontfreetypesvg.cpp index 355e8432aa..71f751329e 100644 --- a/indra/llrender/llfontfreetypesvg.cpp +++ b/indra/llrender/llfontfreetypesvg.cpp @@ -136,18 +136,18 @@ FT_Error LLFontFreeTypeSvgRenderer::OnPresetGlypthSlot(FT_GlyphSlot glyph_slot, float svg_scale = llmin(svg_x_scale, svg_y_scale); datap->Scale = svg_scale; - glyph_slot->bitmap.width = floorf(svg_width) * svg_scale; - glyph_slot->bitmap.rows = floorf(svg_height) * svg_scale; + glyph_slot->bitmap.width = (unsigned int)(floorf(svg_width) * svg_scale); + glyph_slot->bitmap.rows = (unsigned int)(floorf(svg_height) * svg_scale); glyph_slot->bitmap_left = (document->metrics.x_ppem - glyph_slot->bitmap.width) / 2; - glyph_slot->bitmap_top = glyph_slot->face->size->metrics.ascender / 64.f; + glyph_slot->bitmap_top = (FT_Int)(glyph_slot->face->size->metrics.ascender / 64.f); glyph_slot->bitmap.pitch = glyph_slot->bitmap.width * 4; glyph_slot->bitmap.pixel_mode = FT_PIXEL_MODE_BGRA; /* Copied as-is from fcft (MIT license) */ // Compute all the bearings and set them correctly. The outline is scaled already, we just need to use the bounding box. - float horiBearingX = 0.; - float horiBearingY = -glyph_slot->bitmap_top; + float horiBearingX = 0.f; + float horiBearingY = -(float)glyph_slot->bitmap_top; // XXX parentheses correct? float vertBearingX = glyph_slot->metrics.horiBearingX / 64.0f - glyph_slot->metrics.horiAdvance / 64.0f / 2; @@ -156,13 +156,13 @@ FT_Error LLFontFreeTypeSvgRenderer::OnPresetGlypthSlot(FT_GlyphSlot glyph_slot, // Do conversion in two steps to avoid 'bad function cast' warning glyph_slot->metrics.width = glyph_slot->bitmap.width * 64; glyph_slot->metrics.height = glyph_slot->bitmap.rows * 64; - glyph_slot->metrics.horiBearingX = horiBearingX * 64; - glyph_slot->metrics.horiBearingY = horiBearingY * 64; - glyph_slot->metrics.vertBearingX = vertBearingX * 64; - glyph_slot->metrics.vertBearingY = vertBearingY * 64; + glyph_slot->metrics.horiBearingX = (FT_Pos)(horiBearingX * 64); + glyph_slot->metrics.horiBearingY = (FT_Pos)(horiBearingY * 64); + glyph_slot->metrics.vertBearingX = (FT_Pos)(vertBearingX * 64); + glyph_slot->metrics.vertBearingY = (FT_Pos)(vertBearingY * 64); if (glyph_slot->metrics.vertAdvance == 0) { - glyph_slot->metrics.vertAdvance = glyph_slot->bitmap.rows * 1.2f * 64; + glyph_slot->metrics.vertAdvance = (FT_Pos)(glyph_slot->bitmap.rows * 1.2f * 64); } return FT_Err_Ok; |