Chromium Code Reviews| Index: pdf/pdfium/pdfium_engine.cc |
| =================================================================== |
| --- pdf/pdfium/pdfium_engine.cc (revision 275839) |
| +++ pdf/pdfium/pdfium_engine.cc (working copy) |
| @@ -221,6 +221,11 @@ |
| // TODO(kochi): Pass the face in UTF-8. If face is not encoded in UTF-8, |
| // convert to UTF-8 before passing. |
| description.set_face(face); |
| + int normalized_weight = std::min(std::max(weight, 100), 900); |
| + normalized_weight = (normalized_weight / 100) - 1; |
|
jam
2014/06/10 05:47:07
nit: put the 100 and 900 into constants
Lei Zhang
2014/06/10 07:10:27
Done.
|
| + description.set_weight( |
| + static_cast<PP_BrowserFont_Trusted_Weight>(normalized_weight)); |
| + description.set_italic(italic > 0); |
| } |
| if (!pp::PDF::IsAvailable()) { |