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

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

Issue 127813003: Improve 'stretch' in legacy create typeface for DirectWrite. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
« 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 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkTypes.h" 8 #include "SkTypes.h"
9 #undef GetGlyphIndices 9 #undef GetGlyphIndices
10 10
(...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after
1782 1782
1783 if (NULL == fontFamily.get()) { 1783 if (NULL == fontFamily.get()) {
1784 // No family with given name, try default. 1784 // No family with given name, try default.
1785 HRNM(this->getDefaultFontFamily(&fontFamily), "Could not get default fon t family."); 1785 HRNM(this->getDefaultFontFamily(&fontFamily), "Could not get default fon t family.");
1786 } 1786 }
1787 1787
1788 SkTScopedComPtr<IDWriteFont> font; 1788 SkTScopedComPtr<IDWriteFont> font;
1789 DWRITE_FONT_WEIGHT weight = (styleBits & SkTypeface::kBold) 1789 DWRITE_FONT_WEIGHT weight = (styleBits & SkTypeface::kBold)
1790 ? DWRITE_FONT_WEIGHT_BOLD 1790 ? DWRITE_FONT_WEIGHT_BOLD
1791 : DWRITE_FONT_WEIGHT_NORMAL; 1791 : DWRITE_FONT_WEIGHT_NORMAL;
1792 DWRITE_FONT_STRETCH stretch = DWRITE_FONT_STRETCH_UNDEFINED; 1792 DWRITE_FONT_STRETCH stretch = DWRITE_FONT_STRETCH_NORMAL;
1793 DWRITE_FONT_STYLE italic = (styleBits & SkTypeface::kItalic) 1793 DWRITE_FONT_STYLE italic = (styleBits & SkTypeface::kItalic)
1794 ? DWRITE_FONT_STYLE_ITALIC 1794 ? DWRITE_FONT_STYLE_ITALIC
1795 : DWRITE_FONT_STYLE_NORMAL; 1795 : DWRITE_FONT_STYLE_NORMAL;
1796 HRNM(fontFamily->GetFirstMatchingFont(weight, stretch, italic, &font), 1796 HRNM(fontFamily->GetFirstMatchingFont(weight, stretch, italic, &font),
1797 "Could not get matching font."); 1797 "Could not get matching font.");
1798 1798
1799 SkTScopedComPtr<IDWriteFontFace> fontFace; 1799 SkTScopedComPtr<IDWriteFontFace> fontFace;
1800 HRNM(font->CreateFontFace(&fontFace), "Could not create font face."); 1800 HRNM(font->CreateFontFace(&fontFace), "Could not create font face.");
1801 1801
1802 return this->createTypefaceFromDWriteFont(fontFace.get(), font.get(), fontFa mily.get()); 1802 return this->createTypefaceFromDWriteFont(fontFace.get(), font.get(), fontFa mily.get());
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1912 SK_TRACEHR(hr, "Could not get GetUserDefaultLocaleName."); 1912 SK_TRACEHR(hr, "Could not get GetUserDefaultLocaleName.");
1913 } else { 1913 } else {
1914 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N AME_MAX_LENGTH); 1914 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N AME_MAX_LENGTH);
1915 if (localeNameLen) { 1915 if (localeNameLen) {
1916 localeName = localeNameStorage; 1916 localeName = localeNameStorage;
1917 }; 1917 };
1918 } 1918 }
1919 1919
1920 return SkNEW_ARGS(SkFontMgr_DirectWrite, (sysFontCollection.get(), localeNam e, localeNameLen)); 1920 return SkNEW_ARGS(SkFontMgr_DirectWrite, (sysFontCollection.get(), localeNam e, localeNameLen));
1921 } 1921 }
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