[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] proper underline

From: Massimiliano Gubinelli
Subject: Re: [Texmacs-dev] proper underline
Date: Wed, 23 Dec 2020 11:16:45 +0100

Hi Joris,

 yes, I agree with you. 

I do not see a general solution. In most of the cases however I'm willing to sacrifice generality to have a higher quality text-mode underline and leave the current underline as a backup.

1) Would it be possible to implement an "underlined font variant" maybe using a virtual font and combining glyphs with the "_" glyph, which I noticed it is at the right distance (and maybe designed for this purpose in the old ages...)? We need a way to mask certain parts of the underline, so that not all the underline is inking the device. This would solve the problem with backgrounds and avoid my hacky solution.

2) subscripts will pose a problem, indeed, but maybe one can safely assume that when a subscript is present the underline will be covered, so there is nothing to do there.

3) Ideally the approach I was using would also work for more general markup, it could work if we (and the PDF) have a "mask" operation which works at the vectorial level. I need to check what are the operations you implemented for virtual fonts.


On 22. Dec 2020, at 23:33, TeXmacs <texmacs@lix.polytechnique.fr> wrote:

Hi Max,

Yes, I have also been thinking about this problem, which is quite tricky.
There are various difficulties:

 - If we want things to print nicely, then we need a vectorial solution.
   So if we do pixel magic, it must still be vectorial pixel magic.

 - It is problematic if to fatten our fonts using the background color,
   since the background might be a pattern or we might painting on top
   of something else.

 - What should underlining do on more complex markup (a fraction,
   a text with a subscript or superscript, etc.)?

Or do we simply sacrifice some of the things that we might want?

Best wishes, --Joris

On Tue, Dec 22, 2020 at 10:08:21PM +0100, Massimiliano Gubinelli wrote:
Dear all,

I'm not very fond of the \underline style in TeXmacs. Even some browsers (e.g. Safari) do better, in particular put the line nearer to the glyphs and take into account descenders (e.g. "g" or "p"). 

TeX has similar problems and there are solutions around, e.g. here:


Also some CSS trickery can do something for most of the browsers:


I've experimented with similar solutions for TeXmacs. Using \superpose, \datom and \thicken one can indeed create the wanted underline and it works also on the generated PDF file, however \datom does not interact properly with \superpose and one cannot have multiline underlines...

Is there a way to make this work?

I attach a file with my experiments and tentative implementation. (the colors are used to debug)


Texmacs-dev mailing list

Texmacs-dev mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]