Marcel Taeumel uploaded a new version of TrueType to project The Trunk:
http://source.squeak.org/trunk/TrueType-mt.43.mcz ==================== Summary ==================== Name: TrueType-mt.43 Author: mt Time: 13 July 2016, 12:16:44.682029 pm UUID: 571bce8d-fded-5446-bb94-a24cbf015573 Ancestors: TrueType-topa.42 Clean-up some dependencies between Graphics, Morphic, and TrueType. =============== Diff against TrueType-topa.42 =============== Item was added: + ----- Method: LinedTTCFont>>computeForm: (in category 'private') ----- + computeForm: char + + | ttGlyph scale | + + char = Character tab ifTrue: [^ super computeForm: char]. + + "char = $U ifTrue: [self doOnlyOnce: [self halt]]." + scale := self pixelSize asFloat / (ttcDescription ascender - ttcDescription descender). + ttGlyph := ttcDescription at: char. + ^ ttGlyph asFormWithScale: scale ascender: ttcDescription ascender descender: ttcDescription descender fgColor: foregroundColor bgColor: Color transparent depth: self depth replaceColor: false lineGlyph: lineGlyph lingGlyphWidth: contourWidth emphasis: emphasis! Item was added: + ----- Method: TTCFont>>computeForm: (in category 'private') ----- + computeForm: char + "Compute the glyph form for the given character" + ^ttcDescription renderGlyph: char height: self height fgColor: foregroundColor bgColor: Color transparent depth: self depth! Item was added: + ----- Method: TTCFont>>fallbackForm (in category 'private') ----- + fallbackForm + "Compute the glyph form for the fallback glyph" + ^ttcDescription renderFallbackGlyphOfHeight: self height fgColor: foregroundColor bgColor: Color transparent depth: self depth! Item was added: + ----- Method: TTGlyph>>asFormWithScale:ascender:descender: (in category 'converting') ----- + asFormWithScale: scale ascender: ascender descender: descender + ^ self + asFormWithScale: scale + ascender: ascender + descender: descender + fgColor: Color black + bgColor: Color white + depth: 8 + replaceColor: true. + ! Item was added: + ----- Method: TTGlyph>>asFormWithScale:ascender:descender:fgColor:bgColor:depth: (in category 'converting') ----- + asFormWithScale: scale ascender: ascender descender: descender fgColor: fgColor bgColor: bgColor depth: depth + + ^ self + asFormWithScale: scale + ascender: ascender + descender: descender + fgColor: fgColor + bgColor: bgColor + depth: depth + replaceColor: false. + ! Item was added: + ----- Method: TTGlyph>>asFormWithScale:ascender:descender:fgColor:bgColor:depth:replaceColor: (in category 'converting') ----- + asFormWithScale: scale ascender: ascender descender: descender fgColor: fgColor bgColor: bgColor depth: depth replaceColor: replaceColorFlag + + ^ self + asFormWithScale: scale + ascender: ascender + descender: descender + fgColor: fgColor + bgColor: bgColor + depth: depth + replaceColor: replaceColorFlag + lineGlyph: nil + lingGlyphWidth: 0 + emphasis: 0.! Item was added: + ----- Method: TTGlyph>>asFormWithScale:ascender:descender:fgColor:bgColor:depth:replaceColor:lineGlyph:lingGlyphWidth:emphasis: (in category 'converting') ----- + asFormWithScale: scale ascender: ascender descender: descender fgColor: fgColor bgColor: bgColor depth: depth replaceColor: replaceColorFlag lineGlyph: lineGlyph lingGlyphWidth: lWidth emphasis: code + + | form canvas newScale | + form := Form extent: (advanceWidth @ (ascender - descender) * scale) rounded depth: depth. + form fillColor: bgColor. + canvas := BalloonCanvas on: form. + canvas aaLevel: 4. + canvas transformBy: (MatrixTransform2x3 withScale: scale asPoint * (1 @ -1)). + canvas transformBy: (MatrixTransform2x3 withOffset: 0 @ ascender negated). + canvas + drawGeneralBezierShape: self contours + color: fgColor + borderWidth: 0 + borderColor: fgColor. + ((code bitAnd: 4) ~= 0 or: [(code bitAnd: 16) ~= 0]) ifTrue: [ + newScale := (form width + 1) asFloat / lineGlyph calculateWidth asFloat. + canvas transformBy: (MatrixTransform2x3 withScale: (newScale / scale)@1.0). + + (code bitAnd: 4) ~= 0 ifTrue: [ + canvas + drawGeneralBezierShape: lineGlyph contours + color: fgColor + borderWidth: 0 + borderColor: fgColor. + ]. + + (code bitAnd: 16) ~= 0 ifTrue: [ + canvas transformBy: (MatrixTransform2x3 withOffset: 0@(ascender // 2)). + canvas + drawGeneralBezierShape: lineGlyph contours + color: fgColor + borderWidth: 0 + borderColor: fgColor. + ]. + ]. + + replaceColorFlag ifTrue: [ + form replaceColor: bgColor withColor: Color transparent. + ]. + ^ form! |
Free forum by Nabble | Edit this page |