new font not correct view lazarus / 13-General ---------------------------------------------------------------------- mangakissa · 2015-02-14 16:08 Has anyone noticed this? There's a security fix (kb3013455) of windows Vista, which corrupts some fonts. Most applications are using 'courier new' I want to change the font of the editor to 'times new roman, it looks not as it wants to be. A lot of spaces on each character. I put a example of Lazarus an another program with the same font. ---------------------------------------------------------------------- howardpc · 2015-02-14 16:16 Times New Roman is not monospaced (it is proportional) - so the editor does not support it. ---------------------------------------------------------------------- Bart · 2015-02-14 16:20 Try using a monospaced/fixed width font, the IDE doesn't look very nice with proportionally spaced fonts. Maybe Consolas, Deja Vu sans Mono or Lucida Console? For inspiration: http://www.retroprogramming.com/2010/05/10-alternative-monospace- fonts-for.html Bart ---------------------------------------------------------------------- skalogryz · 2015-02-14 16:57 Quote from: howardpc on February 14, 2015, 05:16:08 pmTimes New Roman is not monospaced (it is proportional) - so the editor does not support it. Well, it actually does, as you can see in the screen shot. However, the results would look crappy, since Times New Roman font was not designed for "monospace" The ideology of these two editors (SynEdit) and whatever - notpad-like editors are a bit different. SynEdit is forcing "monospace" ignoring the actual width of the character. The width of the longest character ("W"??) in applied to all other characters.  Try to see how "column" selection would look like in LitePad After all SynEdit is more of 2 dimensional array of characters, rather than a text editor. Unlike notepads it allows to put cursor (and edit) the text - beyond line and/or text bounds. Notepads limit you to put cursor within the text/line only. That however, imposes some limitations, such as -- no wordwrap so far! ---------------------------------------------------------------------- Martin_fr · 2015-02-14 18:44 DejaVu Mono is  a good choice. Quote from: skalogryz on February 14, 2015, 05:57:20 pm The width of the longest character ("W"??) in applied to all other characters.  Usually the "@" You can reduce the spacing by giving a negative "Extra Char Width". But with a that will still not look good. ---------------------------------------------------------------------- skalogryz · 2015-02-14 19:04 2 Martin_fr: Is it possible to make an option to "stretch" characters to the selected width? (i.e. if the actual width of "i" is only 4 pixels (for times new roman) and the selected width is 32 pixels, then "i" would be "stretched" 8-times in width to fill the content) It won't look as good as monospace font, but won't look as "empty" as it looks right now? (the sample is attached) ---------------------------------------------------------------------- Zoran · 2015-02-14 19:46 The author of the following link thinks that proportional fonts should be used for programming: http://nickgravgaard.com/elastictabstops/news/programming-fonts/ ---------------------------------------------------------------------- Martin_fr · 2015-02-14 20:03 Quote from: skalogryz on February 14, 2015, 08:04:47 pmIs it possible to make an option to "stretch" characters to the selected width? Well everything is possible. But: No, that will not be implemented. (well feel free to write a SynPlugin that does do it) I do not know of any OS option / API param that does this. So to archive this, SynEdit would need to: - measure every letter (using the OS/API) - paint every letter to a bitmap - stretch it - put it on the screen that would slow down painting a lot. Besides, one day, I hope to add proportional font support. But that is still a very very long time away. Quote from: Zoran on February 14, 2015, 08:46:22 pmThe author of the following link thinks that proportional fonts should be used for programming: http://nickgravgaard.com/elastictabstops/news/programming-fonts/ There is an existing feature request for elastic tabs, and maybe one day.... All else is personal opinion. I prefer space over any kind of tab. ---------------------------------------------------------------------- skalogryz · 2015-02-14 20:05 Quote from: Martin_fr on February 14, 2015, 09:03:17 pmWell everything is possible. But: No, that will not be implemented. (well feel free to write a SynPlugin that does do it) very likely I will...I can only hope I'll have enough time. Conceptual demo is attached, though. ---------------------------------------------------------------------- skalogryz · 2015-02-14 20:10 Quote from: Zoran on February 14, 2015, 08:46:22 pmThe author of the following link thinks that proportional fonts should be used for programming: http://nickgravgaard.com/elastictabstops/news/programming-fonts/ Usage of monospace fonts historically comes from consoles (text-based output, which was introduced as memory-economy approach)... which in its turn comes from typewriters One big approach here is team work. If a certain team imposes a certain standards to the formatting of the code, then everyone working on the code should follow it. (like them or not). With proportional font - it also requires everyone to use the same font. With mono-space fonts, this isn't necessary. Also, i wonder how far eastern languages people consider the subject. As far as I know all hieroglyph are of the same width. Thus, it looks more natural for them for the whole text to be monospace. ---------------------------------------------------------------------- Zoran · 2015-02-14 22:44 Quote from: Martin_fr on February 14, 2015, 09:03:17 pmQuote from: Zoran on February 14, 2015, 08:46:22 pmThe author of the following link thinks that proportional fonts should be used for programming: http://nickgravgaard.com/elastictabstops/news/programming-fonts/ There is an existing feature request for elastic tabs, and maybe one day.... All else is personal opinion. I prefer space over any kind of tab. Of course it's his personal opinion. I just found his opinion worth mentioning here. By the way, I prefer space over any kind of tab, too. ---------------------------------------------------------------------- Zoran · 2015-02-14 22:50 Quote from: skalogryz on February 14, 2015, 09:10:52 pmAs far as I know all hieroglyph are of the same width. Thus, it looks more natural for them for the whole text to be monospace. Hmm... Actually, if all their characters are of the same with, then all fonts appears monospace, so probably they do not care. EDIT:  Only now I understand what you mean -- Pascal code remains in latin letters, of course, so you do have your point. I should go to sleep. ---------------------------------------------------------------------- Martin_fr · 2015-02-14 23:18 Quote from: skalogryz on February 14, 2015, 09:05:01 pmQuote from: Martin_fr on February 14, 2015, 09:03:17 pmWell everything is possible. But: No, that will not be implemented. (well feel free to write a SynPlugin that does do it) very likely I will...I can only hope I'll have enough time. Conceptual demo is attached, though. See attached what happens to Arabic script (the text is random typing, IF it has a meaning, I am unaware of it) On top SynEdit with monospaced font. But (at least on win) SynEdit can space-out a proportional font, and yet keep the script correct. The issue is, that if you draw letters in a word they form a different glyph. So drawing one by one breaks the output. (Also it displays it backwards, as it is LTR) Quote from: Zoran on February 14, 2015, 11:50:21 pmEDIT:  Only now I understand what you mean -- Pascal code remains in latin letters, of course, so you do have your point. I should go to sleep. Pascal code may have string, and they can be any language ---------------------------------------------------------------------- skalogryz · 2015-02-14 23:32 Quote from: Martin_fr on February 15, 2015, 12:18:51 amSee attached what happens to Arabic script (the text is random typing, IF it has a meaning, I am unaware of it) But (at least on win) SynEdit can space-out a proportional font, and yet keep the script correct. The issue is, that if you draw letters in a word they form a different glyph. So drawing one by one breaks the output. (Also it displays it backwards, as it is LTR) Well, thank you, I'm aware of ligatures and that the demo doesn't support them in any way But let me answer your question what I'd do for the complex scripts. * get the whole complex string as a "bitmap". * the position of each character (relative to the bitmap positions) * slice the "bitmap" on per character into sub-images * draw each sub-image resizing it to fill a column width. Quote from: Martin_fr on February 15, 2015, 12:18:51 amOn top SynEdit with monospaced font. The second (from the right) glyph entered doesn't match the one rendered in SynEdit. Is it expected? ---------------------------------------------------------------------- Martin_fr · 2015-02-14 23:38 Quote from: skalogryz on February 15, 2015, 12:32:56 amThe second (from the right) glyph entered doesn't match the one rendered in SynEdit. Is it expected? I cant read or write Arabic. So I cant judge it. It is a different font. Not sure if that explains it. It is entirely rendered by windows (IIRC). Edit: There is an issue with none spacing marks in SynEdit (SynEdit is not yet fully utf ready). It may be that.