| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, 2009, 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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 ShaperFontDataCache::iterator iter = gFontDataCache->find(fontKey); | 695 ShaperFontDataCache::iterator iter = gFontDataCache->find(fontKey); |
| 696 ShaperFontData* derived; | 696 ShaperFontData* derived; |
| 697 if (iter == gFontDataCache->end()) { | 697 if (iter == gFontDataCache->end()) { |
| 698 ASSERT(wcslen(family) < LF_FACESIZE); | 698 ASSERT(wcslen(family) < LF_FACESIZE); |
| 699 wcscpy_s(logfont->lfFaceName, LF_FACESIZE, family); | 699 wcscpy_s(logfont->lfFaceName, LF_FACESIZE, family); |
| 700 // FIXME: CreateFontIndirect always comes up with | 700 // FIXME: CreateFontIndirect always comes up with |
| 701 // a font even if there's no font matching the name. Need to | 701 // a font even if there's no font matching the name. Need to |
| 702 // check it against what we actually want (as is done in | 702 // check it against what we actually want (as is done in |
| 703 // FontCacheWin.cpp) | 703 // FontCacheWin.cpp) |
| 704 ShaperFontDataCache::AddResult entry = gFontDataCache->add(fontKey, Shap
erFontData()); | 704 ShaperFontDataCache::AddResult entry = gFontDataCache->add(fontKey, Shap
erFontData()); |
| 705 derived = &entry.iterator->value; | 705 derived = &entry.storedValue->value; |
| 706 derived->hfont = CreateFontIndirect(logfont); | 706 derived->hfont = CreateFontIndirect(logfont); |
| 707 // GetAscent may return kUndefinedAscent, but we still want to | 707 // GetAscent may return kUndefinedAscent, but we still want to |
| 708 // cache it so that we won't have to call CreateFontIndirect once | 708 // cache it so that we won't have to call CreateFontIndirect once |
| 709 // more for HFONT next time. | 709 // more for HFONT next time. |
| 710 derived->ascent = getAscent(derived->hfont); | 710 derived->ascent = getAscent(derived->hfont); |
| 711 derived->spaceGlyph = getSpaceGlyph(derived->hfont); | 711 derived->spaceGlyph = getSpaceGlyph(derived->hfont); |
| 712 } else { | 712 } else { |
| 713 derived = &iter->value; | 713 derived = &iter->value; |
| 714 // Last time, getAscent or getSpaceGlyph failed so that only HFONT was | 714 // Last time, getAscent or getSpaceGlyph failed so that only HFONT was |
| 715 // cached. Try once more assuming that TryPreloadFont | 715 // cached. Try once more assuming that TryPreloadFont |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 m_featureRecords.resize(featureSettings->size()); | 1200 m_featureRecords.resize(featureSettings->size()); |
| 1201 for (unsigned i = 0; i < featureSettings->size(); ++i) { | 1201 for (unsigned i = 0; i < featureSettings->size(); ++i) { |
| 1202 m_featureRecords[i].lParameter = featureSettings->at(i).value(); | 1202 m_featureRecords[i].lParameter = featureSettings->at(i).value(); |
| 1203 m_featureRecords[i].tagFeature = convertFeatureTag(featureSettings->at(i
).tag()); | 1203 m_featureRecords[i].tagFeature = convertFeatureTag(featureSettings->at(i
).tag()); |
| 1204 } | 1204 } |
| 1205 m_rangeProperties.potfRecords = &m_featureRecords[0]; | 1205 m_rangeProperties.potfRecords = &m_featureRecords[0]; |
| 1206 m_rangeProperties.cotfRecords = m_featureRecords.size(); | 1206 m_rangeProperties.cotfRecords = m_featureRecords.size(); |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 } // namespace WebCore | 1209 } // namespace WebCore |
| OLD | NEW |