2015-04-29 21:32 GMT+02:00 Nicolai Hess <[email protected]>:

>
>
> 2015-04-29 18:04 GMT+02:00 Sean P. DeNigris <[email protected]>:
>
>> Nicolai Hess wrote
>> > Assign the proper Attribute?
>>
>> Well AFAICT there is no bold attribute,
>
>
> Ah yes, I mix up this with TextMorph and addAttribute:TextEmphasis....
>
>
>> but I tried setting the font to bold
>> via "(LogicalFont familyName: 'Tahoma' pointSize: 9 + i) emphasis: 1;
>> yourself." but it was rendered the same as before...
>>
>>
> If the font is in the system, this should work.
>
> | text font1 font2 font3 string1 |
>     font1 := (LogicalFont familyName: 'Tahoma' pointSize: 25) emphasis:
> TextEmphasis normal emphasisCode.
>     font2 := (LogicalFont familyName: 'Tahoma' pointSize: 25) emphasis:
> TextEmphasis bold emphasisCode.
>     font3 := (LogicalFont familyName: 'Tahoma' pointSize: 25) emphasis:
> TextEmphasis italic emphasisCode.
>

If an emphasisCode is used at low level, that's fine, but shouldn't the API
be more straight like:

   emphasis: aTextEmphasis
or:
  emphasisCode: anIntegerOrSymbolOrLetterOrAnyOtherWayToCodeAnEmphasis

Nicolas

    string1 := 'Normal Bold Italic '.
>     text := TxModel new.
>     text at: text startPosition insert: string1.
>
>     (text startPosition selectTo: text startPosition + 7)
>         applyAttribute: (TxForeColorAttribute with: Color red);
>         applyAttribute: (TxFontAttribute with: font1).
>
>     (text startPosition + 7 selectTo: text startPosition + 12)
>         applyAttribute: (TxForeColorAttribute with: Color green);
>         applyAttribute: (TxFontAttribute with: font2).
>
>     (text startPosition + 12 selectTo: text startPosition + 18)
>         applyAttribute: (TxForeColorAttribute with: Color blue);
>         applyAttribute: (TxFontAttribute with: font3).
>
>     TxTextEditorMorph openInWindowWithText: text
>
>
>
>
>
>
>>
>>
>> -----
>> Cheers,
>> Sean
>> --
>> View this message in context:
>> http://forum.world.st/Tx-Bold-Text-tp4822964p4822987.html
>> Sent from the Pharo Smalltalk Developers mailing list archive at
>> Nabble.com.
>>
>>
>

Reply via email to