Index: ui/gfx/render_text_harfbuzz.cc |
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc |
index a9a05ef7d153ca44d72278555677de847ae2d403..4f8a23730addff9283ea391b87db9ea0cd44ee4c 100644 |
--- a/ui/gfx/render_text_harfbuzz.cc |
+++ b/ui/gfx/render_text_harfbuzz.cc |
@@ -576,10 +576,10 @@ TextRunHarfBuzz::TextRunHarfBuzz() |
baseline_offset(0), |
baseline_type(0), |
font_style(0), |
+ weight(gfx::Font::WEIGHT_NORMAL), |
strike(false), |
diagonal_strike(false), |
- underline(false) { |
-} |
+ underline(false) {} |
TextRunHarfBuzz::~TextRunHarfBuzz() {} |
@@ -1259,17 +1259,17 @@ void RenderTextHarfBuzz::ItemizeTextToRuns( |
DCHECK_LE(text.size(), baselines().max()); |
for (const BreakList<bool>& style : styles()) |
DCHECK_LE(text.size(), style.max()); |
- internal::StyleIterator style(empty_colors, baselines(), styles()); |
+ internal::StyleIterator style(empty_colors, baselines(), weights(), styles()); |
for (size_t run_break = 0; run_break < text.length();) { |
internal::TextRunHarfBuzz* run = new internal::TextRunHarfBuzz; |
run->range.set_start(run_break); |
- run->font_style = (style.style(BOLD) ? Font::BOLD : 0) | |
- (style.style(ITALIC) ? Font::ITALIC : 0); |
+ run->font_style = (style.style(ITALIC) ? Font::ITALIC : 0); |
msw
2016/03/22 01:53:44
nit: convert to bool flag for italic.
Mikus
2016/03/22 14:19:51
Done.
|
run->baseline_type = style.baseline(); |
run->strike = style.style(STRIKE); |
run->diagonal_strike = style.style(DIAGONAL_STRIKE); |
run->underline = style.style(UNDERLINE); |
+ run->weight = style.weight(); |
int32_t script_item_break = 0; |
bidi_iterator.GetLogicalRun(run_break, &script_item_break, &run->level); |
CHECK_GT(static_cast<size_t>(script_item_break), run_break); |
@@ -1455,7 +1455,7 @@ bool RenderTextHarfBuzz::ShapeRunWithFont(const base::string16& text, |
const FontRenderParams& params, |
internal::TextRunHarfBuzz* run) { |
skia::RefPtr<SkTypeface> skia_face = |
- internal::CreateSkiaTypeface(font, run->font_style); |
+ internal::CreateSkiaTypeface(font, run->font_style, run->weight); |
if (skia_face == NULL) |
return false; |
run->skia_face = skia_face; |