Hi,
The fonts-related code is a bit too complex for my mind.
Semi bold is indeed not a FreeTypeFontFamily, but a FreeTypeFontFamilyMember.
After loading the font, you can inspect it via: (LogicalFontManager current allFamilies detect: [:each | each familyName = 'Source Code Pro' ]) members detect: [ :each | each styleName = 'Semibold' ].
You will see that it has a couple of integer values for: stretch, weight and slant. The only way I could set a LogicalFont from outside was via these values explicitly:
StandardFonts codeFont: (LogicalFont familyName: 'Source Code Pro' pointSize: 10 stretchValue: 5 weightValue: 600 slantValue: 0).
I guess we need to review this part of Pharo.
Cheers, Doru
On May 11, 2013, at 5:39 PM, stephane ducasse stephane.ducasse@free.fr wrote:
Hi doru
How do you use SourceCodeProSemibold for example StandardFonts codeFont: (LogicalFont familyName: 'Source Code Pro' pointSize: 10).
Because there is no family name for semi bold
Stef
On May 11, 2013, at 12:21 AM, Tudor Girba tudor@tudorgirba.com wrote:
Hi,
To ease the transition to Athens, we need to get free type fonts in the image. I researched a bit, and found a couple of font families that are nicely free and open-source: DejaVu, Source Code Pro, Source Sans Pro, and LinLibertine.
I put together a little tool that imports a TTF file and installs it in a dedicated class. You can find a library of already imported fonts on SmalltalkHub: http://www.smalltalkhub.com/#!/~girba/FreeFonts/
More details about this library can be found at: http://www.tudorgirba.com/blog/free-font-collection-for-pharo
For example, you can use the SourceCodeProRegular font as a code font like: Gofer new smalltalkhubUser: 'girba' project: 'FreeFonts'; package: 'SourceCodeProRegular'; load. (Smalltalk at: #SourceCodeProRegular) new install. FreeTypeSystemSettings loadFt2Library: true. StandardFonts codeFont: (LogicalFont familyName: 'Source Code Pro' pointSize: 10).
The Moose image already comes with a convenience method to set a complete free type font set: MooseImageSetupCommandLineHandler new installFonts.
Cheers, Doru
-- www.tudorgirba.com
"Be rather willing to give than demanding to get."
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- www.tudorgirba.com
"If you can't say why something is relevant, it probably isn't."