Re: [code][Textadept] hardcoded title font size in Markdown lexer

From: Franck Guadagnini <franckguadagnini.att.me.com>
Date: Thu, 17 Aug 2017 08:46:55 +0200

Hi Mitchell,

Is there an editor-agnostic way to determine the width of a character, maybe directly using SCI_TEXTWIDTH (char "m" for instance, because it should have about the same width in monospace and non-monospace font)? If so, after some testing to get the relation between the width of the char and the size of the font, the titles' size increase could be computed from it?

Cheers,
Franck

> Le 17 août 2017 à 03:32, Mitchell <m.att.foicica.com> a écrit :
>
> Hi Franck,
>
> On Wed, 16 Aug 2017, Franck Guadagnini wrote:
>
>> Hi,
>>
>> In the Markdown lexer, the titles are supposed to be drawn bigger than the normal text, but the base font size is hardcoded to 10 points. If, like me, you use a big base font size, the titles will actually display *smaller* than the text. To correct this, it's only needed to replace, at line 84 of lexers/markdown.lua,
>>
>> local font_size = 10
>>
>> by
>>
>> local font_size = buffer.property['fontsize'].
>>
>> Mitchell, you may be interested in pushing this little change upstream?
>
> This would work for Textadept, but the lexers are part of another project, Scintillua[1], that is editor-agnostic. Applying this change would break lexing for downstream users. I completely agree that hardcoding the size is not ideal, but I'm not sure what the best solution is. Forcing downstream users to define a markdown-specific property is not something I'd want to do. If you have another suggestion, I'd be happy to hear. Otherwise, keeping your own copy of *markdown.lua* with your change is probably best for now.
>
> Cheers,
> Mitchell
>
> [1]: http://foicica.com/scintillua <http://foicica.com/scintillua>
> --
> You are subscribed to code.att.foicica.com <mailto:code.att.foicica.com>.
> To change subscription settings, send an e-mail to code+help.att.foicica.com <mailto:code+help.att.foicica.com>.
> To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com <mailto:code+unsubscribe.att.foicica.com>.

-- 
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 Thu 17 Aug 2017 - 02:46:55 EDT

This archive was generated by hypermail 2.2.0 : Thu 17 Aug 2017 - 06:33:44 EDT