Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: Source/platform/fonts/shaping/HarfBuzzFace.cpp

Issue 1292583006: Revert of Add Unicode Variation Selector support on Linux official builds (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 extents->width = SkiaScalarToHarfBuzzPosition(skBounds.width()); 155 extents->width = SkiaScalarToHarfBuzzPosition(skBounds.width());
156 extents->height = SkiaScalarToHarfBuzzPosition(-skBounds.height()); 156 extents->height = SkiaScalarToHarfBuzzPosition(-skBounds.height());
157 } 157 }
158 } 158 }
159 159
160 static hb_bool_t harfBuzzGetGlyph(hb_font_t* hbFont, void* fontData, hb_codepoin t_t unicode, hb_codepoint_t variationSelector, hb_codepoint_t* glyph, void* user Data) 160 static hb_bool_t harfBuzzGetGlyph(hb_font_t* hbFont, void* fontData, hb_codepoin t_t unicode, hb_codepoint_t variationSelector, hb_codepoint_t* glyph, void* user Data)
161 { 161 {
162 HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(fontData) ; 162 HarfBuzzFontData* hbFontData = reinterpret_cast<HarfBuzzFontData*>(fontData) ;
163 163
164 if (variationSelector) { 164 if (variationSelector) {
165 #if OS(LINUX) && !defined(OFFICIAL_BUILD) 165 #if OS(LINUX)
166 // TODO(kojii): Linux non-official builds cannot use hb_ot_font_set_func s() 166 // TODO(kojii): Linux non-official builds cannot use new HB APIs
167 // until we find a way to bundle HB in non-official builds, or pangoft2 167 // until crbug.com/462689 resolved or pangoft2 updates its HB.
168 // updates its HB. See crbug.com/462689.
169 return false; 168 return false;
170 #else 169 #else
171 // Skia does not support variation selectors, but hb does. 170 // Skia does not support variation selectors, but hb does.
172 // We're not fully ready to switch to hb-ot-font yet, 171 // We're not fully ready to switch to hb-ot-font yet,
173 // but are good enough to get glyph IDs for OpenType fonts. 172 // but are good enough to get glyph IDs for OpenType fonts.
174 if (!hbFontData->m_hbOpenTypeFont) { 173 if (!hbFontData->m_hbOpenTypeFont) {
175 hbFontData->m_hbOpenTypeFont = hb_font_create(hbFontData->m_face); 174 hbFontData->m_hbOpenTypeFont = hb_font_create(hbFontData->m_face);
176 hb_ot_font_set_funcs(hbFontData->m_hbOpenTypeFont); 175 hb_ot_font_set_funcs(hbFontData->m_hbOpenTypeFont);
177 } 176 }
178 return hb_font_get_glyph(hbFontData->m_hbOpenTypeFont, unicode, variatio nSelector, glyph); 177 return hb_font_get_glyph(hbFontData->m_hbOpenTypeFont, unicode, variatio nSelector, glyph);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 hb_font_t* font = hb_font_create(m_face); 335 hb_font_t* font = hb_font_create(m_face);
337 hb_font_set_funcs(font, harfBuzzSkiaGetFontFuncs(), hbFontData, destroyHarfB uzzFontData); 336 hb_font_set_funcs(font, harfBuzzSkiaGetFontFuncs(), hbFontData, destroyHarfB uzzFontData);
338 float size = m_platformData->size(); 337 float size = m_platformData->size();
339 int scale = SkiaScalarToHarfBuzzPosition(size); 338 int scale = SkiaScalarToHarfBuzzPosition(size);
340 hb_font_set_scale(font, scale, scale); 339 hb_font_set_scale(font, scale, scale);
341 hb_font_make_immutable(font); 340 hb_font_make_immutable(font);
342 return font; 341 return font;
343 } 342 }
344 343
345 } // namespace blink 344 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698