Tobias Pape uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-topa.936.mcz ==================== Summary ==================== Name: Morphic-topa.936 Author: topa Time: 27 April 2015, 12:11:39.231 am UUID: 932f9fee-aadb-41b8-b560-a9a89ae62d36 Ancestors: Morphic-mt.935 Refactor Font importer to lose all hard-coded pixels and use ToolBuilder better. Also, make glyph-finding more robust =============== Diff against Morphic-mt.935 =============== Item was changed: ----- Method: FontImporterTool>>buildPreviewPaneWith: (in category 'toolbuilder') ----- buildPreviewPaneWith: builder "Build the preview panel" ^ builder pluggablePanelSpec new children: { + builder pluggableInputFieldSpec new - builder pluggableTextSpec new model: self; getText: #filename; + readOnly: true; + indicateUnacceptedChanges: false; + font: self filenameFont; frame: (LayoutFrame fractions: (0@0 corner: 1@0) + offsets: (0@0 corner: 0@ self filenameHeight)); - offsets: (0@0 corner: 0@ -25)); yourself. (self buildCodePaneWith: builder) name: #preview; + askBeforeDiscardingEdits: false; + indicateUnacceptedChanges: false; frame: (LayoutFrame fractions: (0@0 corner: 1@0.75) + offsets: (0@ self filenameHeight corner: 0@0)); - offsets: (0@ 30 corner: 0@0)); yourself. builder pluggableTextSpec new model: self; getText: #copyright; + readOnly: true; + indicateUnacceptedChanges: false; frame: (LayoutFrame fractions: (0@0.75 corner: 1@1)); yourself }; yourself! Item was changed: ----- Method: FontImporterTool>>buttonHeight (in category 'toolbuilder') ----- buttonHeight + ^ Preferences standardButtonFont height * 3! - ^Preferences standardButtonFont height + 25! Item was added: + ----- Method: FontImporterTool>>filenameFont (in category 'toolbuilder') ----- + filenameFont + ^ Preferences standardDefaultTextFont! Item was added: + ----- Method: FontImporterTool>>filenameHeight (in category 'toolbuilder') ----- + filenameHeight + ^ (self filenameFont lineGrid * 1.5) truncated! Item was changed: ----- Method: FontImporterTool>>font:hasGlyphOf: (in category 'toolbuilder') ----- font: f hasGlyphOf: aCharacter + | font | + font := f isFontSet ifTrue: [f fontArray first] ifFalse: [f]. + ^ font isTTCFont + ifFalse: [font hasGlyphOf: aCharacter] - ^ f isTTCFont - ifFalse: [f hasGlyphOf: aCharacter] ifTrue: [ " [(f hasGlyphOf: aCharacter) not] does not work, the fallback glyph is always found instead. So we fake. if aCharacter is the same form as Character null aka 0, we assume absence." + (font characterFormAt: aCharacter) bits ~= font fallbackForm bits] - (f formOf: aCharacter) bits ~= f fallbackForm bits] ! |
Free forum by Nabble | Edit this page |