termux-app icon indicating copy to clipboard operation
termux-app copied to clipboard

True italic fonts.

Open j0ng4b opened this issue 2 years ago • 10 comments

Closes #711. Adds support to true italic fonts. If an italic font file (~/.termux/font-italic.ttf) not exists, fallback to previous italic effect.

One thing that maybe can be an issue is to use two different kinds of fonts. This isn't easy to handle with my current knowledge of the code then should be avoided if possible (sane people will not use two different fonts, I hope...).

j0ng4b avatar Jun 09 '22 04:06 j0ng4b

If this PR is merged please add a corresponding tip here: https://wiki.termux.com/wiki/Termux:Styling

2096779623 avatar Jun 19 '22 07:06 2096779623

One thing that maybe can be an issue is to use two different kinds of fonts.

@j0ng4b I couldn't understand that. Can you provide an example?

I tried this PR with two different fonts and it works:

  • Regular font (~/.termux/font.ttf): Hack regular nerd font.
  • Italic font (~/.termux/font-italic.ttf): Inconsolata italic nerd font.

Screenshot_2022-07-06-10-41-16-125

MrAdityaAlok avatar Jul 06 '22 05:07 MrAdityaAlok

I couldn't understand that. Can you provide an example?

This is most related to the render function that's do all the math before draw things on the canvas (if I don't miss understood). This by now only consider the normal font dimensions (line height, acent etc...) to do this math if this dimensions differ from normal and italic the text could be wrong draw (maybe I'm wrong about this).

For example, the fonts with the same or almost the same dimensions: Same dimensions fonts

When mixing the italic text and normal text everything goes well in this case, but when using fonts with different dimensions this is the result: Different fonts dimensions case one

Different fonts dimensions case two

On the two images the result is different because the base (non-italic) font width used to do the math before draw change in the two fonts.

j0ng4b avatar Jul 08 '22 01:07 j0ng4b

Why is this not merged? This works perfect.

budchirp avatar Jul 12 '22 08:07 budchirp

Why is this not merged?

image

2096779623 avatar Jul 12 '22 08:07 2096779623

Screenshot_20220712-110921_Termux

budchirp avatar Jul 12 '22 08:07 budchirp

Waiting for this project to be fixed and merged

rendiix avatar Jul 25 '22 15:07 rendiix

@j0ng4b @agnostic-apollo can this be merged?

luisdavim avatar Aug 17 '22 23:08 luisdavim

Waiting for this PR merge conflicts to be resolved to see if it fixes my italic clipping issues with neovim. Any progress?

Xemptuous avatar Nov 09 '22 21:11 Xemptuous

Hopefully it's fixed soon

rendiix avatar Nov 16 '22 02:11 rendiix

Please, resolve the conflicts 🙏

hacker-hackman avatar Nov 30 '22 10:11 hacker-hackman

For anyone who wants to build, the PR is still working, there's very simple conflicts

TermuxMonet avatar Nov 30 '22 16:11 TermuxMonet

Any updates?

mrtnvgr avatar Feb 18 '23 03:02 mrtnvgr

When I get some time I'll work on improve this (maybe add true bold fonts) and fix the conflicts.

j0ng4b avatar Feb 26 '23 14:02 j0ng4b

Hey, are there any updates on this?

Duckulus avatar Sep 17 '23 19:09 Duckulus