Re: [code] [textadept] Theming

From: Mitchell <m.att.foicica.com>
Date: Wed, 26 Jun 2013 09:59:14 -0400 (Eastern Daylight Time)

Robert,

On Tue, 25 Jun 2013, Robert wrote:

> On Fri, Jun 21, 2013 at 9:53 PM, Mitchell <m.att.foicica.com> wrote:
>>> * What do you think about having a font adjusting API like
>>>
>>> set_theme(theme, font, fontsize) e.g.
>>>
>>> set_theme('darker', 'Monaco', 12)
>>>
>>> The last two options would be optional and would otherwise be set to
>>> the values now present in each theme.
>>
>>
>> Something more powerful is now in hg. `gui.set_theme()` accepts optional
>> key-value argument pairs for properties. In your case, you would call it
>> like this:
>>
>> gui.set_theme('darker', 'font', 'Monaco', 'fontsize', 12)
>
> This is indeed more powerful -- but I was hoping this could replace
> the setting of fonts in theme files.
> Maybe the font setting could still be moved into 'gui.set_theme'?
>
> for i = 1, #_VIEWS do
> gui.goto_view(i)
> dofile(name)
> property['font'], property['fontsize'] = 'Bitstream Vera Sans Mono', 10
> if WIN32 then
> property['font'] = 'Courier New'
> elseif OSX then
> property['font'], property['fontsize'] = 'Monaco', 12
> end
> for j = 1, #props, 2 do buffer.property[props[j]] = props[j + 1] end
> end
>
> This would avoid code duplication and prevent theme authors from
> messing with the default fonts.

I believe font settings are a part of themes. All editors I've seen couple
syntax highlighting colors with fonts and font sizes. I don't want to
cause confusion by separating them. Also, keep in mind that 'font' and
'fontsize' are arbitary properties used in default themes by
'style.default'. There is nothing to keep user themes from using different
property names or putting fonts directly into styles.

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 26 Jun 2013 - 09:59:14 EDT

This archive was generated by hypermail 2.2.0 : Thu 27 Jun 2013 - 06:37:58 EDT