From hannes.hirzel at gmail.com Mon Apr 10 10:29:30 2017 From: hannes.hirzel at gmail.com (H. Hirzel) Date: Mon, 10 Apr 2017 12:29:30 +0200 Subject: [Newbies] What is the regular way to create a StringMorph with a particular font size? Message-ID: Hello I am wondering how a short version of constructing a StringMorph with a particular TextStyle looks like. The version which is attached works fine. The question is mainly How do I replace (TextConstants at: #LiberationSans) fontArray at: 7 with something which directly refers to the point size? And as a second question how do I get from the number of desired screen pixels to the closest font size? Regards Hannes -------------- next part -------------- A non-text attachment was scrubbed... Name: LiberationSans60point.png Type: image/png Size: 21086 bytes Desc: not available URL: From hannes.hirzel at gmail.com Mon Apr 10 11:11:10 2017 From: hannes.hirzel at gmail.com (H. Hirzel) Date: Mon, 10 Apr 2017 13:11:10 +0200 Subject: [Newbies] What is the regular way to create a StringMorph with a particular font size? In-Reply-To: References: Message-ID: P.S. I had changed TTCFont pointSizes "The default sizes that are created when a TextStyle is created. You can add new sizes by the new-size feature." ^ #(9 12 15 24 36). in my image _before_ importing a TrueType font. TTCFont pointSizes is now pointSizes "The default sizes that are created when a TextStyle is created. You can add new sizes by the new-size feature." ^ #(9 12 15 24 36 48 60). And the font loaded is LiberationSans https://pagure.io/liberation-fonts The Liberation Fonts are intended to be replacements for the three most commonly used fonts on Microsoft systems: - Times New Roman, - Arial and - Courier \ New. On 4/10/17, H. Hirzel wrote: > Hello > > I am wondering how a short version of constructing a StringMorph with > a particular TextStyle looks like. > > The version which is attached works fine. > > The question is mainly > > How do I replace > > (TextConstants at: #LiberationSans) fontArray at: 7 > > with something which directly refers to the point size? > > And as a second question how do I get from the number of desired > screen pixels to the closest font size? > > Regards > Hannes > From dnorton at mindspring.com Mon Apr 10 17:14:19 2017 From: dnorton at mindspring.com (Dan Norton) Date: Mon, 10 Apr 2017 13:14:19 -0400 Subject: [Newbies] What is the regular way to create a StringMorph with a particular font size? In-Reply-To: References: Message-ID: Hi Hannes, On 04/10/2017 07:11 AM, H. Hirzel wrote: > P.S. > > I had changed > > TTCFont pointSizes > > "The default sizes that are created when a TextStyle is created. > You can add new sizes by the new-size feature." > ^ #(9 12 15 24 36). > > in my image _before_ importing a TrueType font. > > > > > TTCFont pointSizes > > is now > > pointSizes > > "The default sizes that are created when a TextStyle is created. You > can add new sizes by the new-size feature." > ^ #(9 12 15 24 36 48 60). > > > And the font loaded is LiberationSans > > https://pagure.io/liberation-fonts > > The Liberation Fonts are intended to be replacements > for the three most commonly used fonts on Microsoft systems: > - Times New Roman, > - Arial and > - Courier \ New. > > On 4/10/17, H. Hirzel wrote: >> Hello >> >> I am wondering how a short version of constructing a StringMorph with >> a particular TextStyle looks like. With Cuis, if you have the font in the 'AdditionalFontData' directory, maybe the following? | w nam | nam := 'LiberationSans'. w := AbstractFont familyName: nam aroundPointSize: 10. (StringMorph contents: 'Some text in "', nam, '" font.' font: w) openInHand. I don't have your TrueType font, but the above works for the DejaVu Sans Mono font. This example appears in Terse Guide. - Dan >> >> The version which is attached works fine. >> >> The question is mainly >> >> How do I replace >> >> (TextConstants at: #LiberationSans) fontArray at: 7 >> >> with something which directly refers to the point size? >> >> And as a second question how do I get from the number of desired >> screen pixels to the closest font size? >> >> Regards >> Hannes >> > _______________________________________________ > Beginners mailing list > Beginners at lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners