Android Font
FontSet
1.FontCache.cpp
- FontPlatformData* FontCache::getCachedFontPlatformData(
- const FontDescription& fontDescription,
- const AtomicString& familyName,
- bool checkingAlternateName)
- {...
- result = createFontPlatformData(fontDescription, familyName);
- ....
- }
2.FontCacheAndroid.cpp
- FontPlatformData* FontCache::createFontPlatformData(const FontDescription&
- fontDescription, const AtomicString& family)
- {
- ....
- if (family.length()) {
- storage = AtomicStringToUTF8String(family);
- name = storage;
- } else
- name = getFallbackFontName(fontDescription);
- int style = SkTypeface::kNormal;
- if (fontDescription.weight() >= FontWeightBold)
- style |= SkTypeface::kBold;
- if (fontDescription.italic())
- style |= SkTypeface::kItalic;
- ....
- }
3. FontPlatformDataAndroid.cpp
- FontPlatformData::FontPlatformData(SkTypeface* tf, float textSize,
- bool fakeBold, bool fakeItalic)
- : mTypeface(tf), mTextSize(textSize), mFakeBold(fakeBold),
- mFakeItalic(fakeItalic)
- {
- if (hashTableDeletedFontValue() != mTypeface) {
- SkSafeRef(mTypeface);
- }
- inc_count();
- trace(3);
- }
 so the bold info is in the FontPlatformData.
font draw
1.FontAndroid.cpp
- void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
- const GlyphBuffer& glyphBuffer, int from, int numGlyphs,
- const FloatPoint& point) const
- {
- ...
- if (!setupForText(&paint, gc, font)) {
- return;
- }
- ...
- canvas->drawPosText(glyphs, numGlyphs * sizeof(uint16_t), pos, paint);
- }
2 .SkCanvas.cpp
- void SkCanvas::drawPosText(const void* text, size_t byteLength,
- const SkPoint pos[], const SkPaint& paint) {
- ....
- }
  Android draw from render to glear
for android from InlineTextBox to skia
 1.InlineTextBox.cpp paint
 2.InlineTextBox.cpp paintTextWithShadows
 3.GraphicsContext.cpp drawText
 4.Font.cpp void Font::drawText
 5.FontFastPath.cpp drawSimpleText
 6.FontFastPath.cpp drawGlyphBuffer
 7.FontAndroid.cpp drawGlyphs
from skia to platform graphic
1.SkCanvas.drawPosText.
SkCanvas has many such DrawXXX functions.
2.SkDevice.drawPosText
SkDevice also has many such DrawXXX functions as above.
3.SkPaint .drawPosText
SkPaint has many such DrawXXX functions as above
4.SkDraw.drawPosText
5.SkDraw1Glyph::Proc proc=d1g.init(this, blitter.get(), cache).
proc(d1g, fx, fy, glyph);
6.
SkDraw1Glyph::Proc SkDraw1Glyph::init()
it's definition is in SkDraw.cpp init()
so proc will be "D1G_NoBounder_RectClip" or "D1G_NoBounder_RgnClip" or "D1G_Bounder".
7?
how to call the platform's graphic? i havn't found out.
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号