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

Side by Side Diff: src/ports/SkFontHost_win.cpp

Issue 434623002: Remove ALL font fallback logic from Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix win font host Created 6 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 | « src/ports/SkFontHost_mac.cpp ('k') | tests/AndroidPaintTest.cpp » ('j') | 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkAdvancedTypefaceMetrics.h" 9 #include "SkAdvancedTypefaceMetrics.h"
10 #include "SkBase64.h" 10 #include "SkBase64.h"
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 866
867 void SkScalerContext_GDI::generateAdvance(SkGlyph* glyph) { 867 void SkScalerContext_GDI::generateAdvance(SkGlyph* glyph) {
868 this->generateMetrics(glyph); 868 this->generateMetrics(glyph);
869 } 869 }
870 870
871 void SkScalerContext_GDI::generateMetrics(SkGlyph* glyph) { 871 void SkScalerContext_GDI::generateMetrics(SkGlyph* glyph) {
872 SkASSERT(fDDC); 872 SkASSERT(fDDC);
873 873
874 if (fType == SkScalerContext_GDI::kBitmap_Type || fType == SkScalerContext_G DI::kLine_Type) { 874 if (fType == SkScalerContext_GDI::kBitmap_Type || fType == SkScalerContext_G DI::kLine_Type) {
875 SIZE size; 875 SIZE size;
876 WORD glyphs = glyph->getGlyphID(0); 876 WORD glyphs = glyph->getGlyphID();
877 if (0 == GetTextExtentPointI(fDDC, &glyphs, 1, &size)) { 877 if (0 == GetTextExtentPointI(fDDC, &glyphs, 1, &size)) {
878 glyph->fWidth = SkToS16(fTM.tmMaxCharWidth); 878 glyph->fWidth = SkToS16(fTM.tmMaxCharWidth);
879 } else { 879 } else {
880 glyph->fWidth = SkToS16(size.cx); 880 glyph->fWidth = SkToS16(size.cx);
881 } 881 }
882 glyph->fHeight = SkToS16(size.cy); 882 glyph->fHeight = SkToS16(size.cy);
883 883
884 glyph->fTop = SkToS16(-fTM.tmAscent); 884 glyph->fTop = SkToS16(-fTM.tmAscent);
885 // Bitmap FON cannot underhang, but vector FON may. 885 // Bitmap FON cannot underhang, but vector FON may.
886 // There appears no means of determining underhang of vector FON. 886 // There appears no means of determining underhang of vector FON.
(...skipping 17 matching lines...) Expand all
904 glyph->fHeight = SkScalarTruncToInt(bounds.height()); 904 glyph->fHeight = SkScalarTruncToInt(bounds.height());
905 } 905 }
906 906
907 // Apply matrix to advance. 907 // Apply matrix to advance.
908 glyph->fAdvanceY = SkFixedMul(-SkFIXEDToFixed(fMat22.eM12), glyph->fAdva nceX); 908 glyph->fAdvanceY = SkFixedMul(-SkFIXEDToFixed(fMat22.eM12), glyph->fAdva nceX);
909 glyph->fAdvanceX = SkFixedMul(SkFIXEDToFixed(fMat22.eM11), glyph->fAdvan ceX); 909 glyph->fAdvanceX = SkFixedMul(SkFIXEDToFixed(fMat22.eM11), glyph->fAdvan ceX);
910 910
911 return; 911 return;
912 } 912 }
913 913
914 UINT glyphId = glyph->getGlyphID(0); 914 UINT glyphId = glyph->getGlyphID();
915 915
916 GLYPHMETRICS gm; 916 GLYPHMETRICS gm;
917 sk_bzero(&gm, sizeof(gm)); 917 sk_bzero(&gm, sizeof(gm));
918 918
919 DWORD status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX , &gm, 0, NULL, &fMat22); 919 DWORD status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX , &gm, 0, NULL, &fMat22);
920 if (GDI_ERROR == status) { 920 if (GDI_ERROR == status) {
921 LogFontTypeface::EnsureAccessible(this->getTypeface()); 921 LogFontTypeface::EnsureAccessible(this->getTypeface());
922 status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, &fMat22); 922 status = GetGlyphOutlineW(fDDC, glyphId, GGO_METRICS | GGO_GLYPH_INDEX, &gm, 0, NULL, &fMat22);
923 if (GDI_ERROR == status) { 923 if (GDI_ERROR == status) {
924 glyph->zeroMetrics(); 924 glyph->zeroMetrics();
(...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after
2587 2587
2588 private: 2588 private:
2589 SkTDArray<ENUMLOGFONTEX> fLogFontArray; 2589 SkTDArray<ENUMLOGFONTEX> fLogFontArray;
2590 }; 2590 };
2591 2591
2592 /////////////////////////////////////////////////////////////////////////////// 2592 ///////////////////////////////////////////////////////////////////////////////
2593 2593
2594 SkFontMgr* SkFontMgr_New_GDI() { 2594 SkFontMgr* SkFontMgr_New_GDI() {
2595 return SkNEW(SkFontMgrGDI); 2595 return SkNEW(SkFontMgrGDI);
2596 } 2596 }
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | tests/AndroidPaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698