BowPad
BowPad copied to clipboard
tab size and monospace font problems
from #376: Some monospaced fonts seem to have an issue with spaces (and it seems line height too). Spaces don't seem to count as a single font space, but less. Example below...
TAB size doesn't seem to work properly in some cases. I use a filetype .mnx to create README files for software I use, with things like how to extract and install portable software, how to update, the author URL and information, etc.. But the tab size is always 8 when I open those files, even tho in the ribbon indicates a size of 4.. This is fixed by setting the size to 3 and then back to 4, but this has to be done every time a file is open.
Font: Consolas | Tab size: 4
Font: Consolas | Tab size: 4 (after setting the size to 3 and then back to 4)
Font: Consolas NF3 (This is the same "Consolas" font patched with Nerd Fonts Patcher)
Font: Consolas NF3 (This is how it looks in EditPlus)
Font: Consolas NF3 (This is how it looks in Visual Studio Code)
I attach the Windows font Consolas and the patched font Consolas NF3 in case they're of use..
is there an .editorconfig file that sets a tab size beneath or up the file tree?
is there an .editorconfig file that sets a tab size beneath or up the file tree?
@stefankueng I checked.. But no .editorconfig file in the BowPad up or down the directory tree.
Just in case, I tried copying the program folder to the root drive:
Best regards!
could you attach the mnx file (the part visible in the screenshot is enough in case there's info in there you don't want to share). And then which lexer do you use for those files?
Sure, here's the complete file in a .zip archive. I just use it to take notes of software and how to update in portable mode.
@stefankueng I used no lexer in BowPad for that file.
But I just tried to use the following lexers: txt, php, json, c sharp..
Same reasult.
Post data: Also, I don't think the issue is with any particular filetype. I just tried putting the same header text other filetypes with the same result (.ini .txt .php)
thanks! I can now reproduce the problem. Working on it...
found a similar issue here: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/10608
basically, if you add [View] d2d=0
to the config file and restart BP, the issue won't show. But then you don't get the ligatures.
But I think I found the problem: the font is not properly monospaced! Using the "consolas NP3" font you attached above and then calling the GetClusterMetrics API, the result shows different widths for some chars (not just space but also ,. and others)
So I'm closing this issue since it's really the font that's not quite correct and a workaround exists.
@stefankueng ok, I tried patching again the font, so it seems to work now, with some minor discrepancies:
I used the same exact command to patch the font. The only difference is that the fontpatcher script version is currently at v3.2.1 but before it was v3.0~ when I originally patched the font.
However, I have to make the point that even if the patching was flawed the font worked fine in other editors. I mention this just in case, and to keep in mind in case of any future issues.
basically, if you add [View] d2d=0
to the config file and restart BP, the issue won't show. But then you don't get the ligatures.
I did tried this workaround first but didn't work for me, nothing happened. I did noticed that the "d2d=0" setting dissapeared from the "settings" file every time after I closed the editor.
Best regards..
Post data: I attach the latest patched font:
first: other editors where the font works most likely don't use DirectWrite and don't show ligatures. They use the 'old' APIs to draw text. DirectWrite is the API set that supports ligatures and other new features of fonts which the old APIs don't.
So I'm guessing the font patcher misses some of the new features for fonts and doesn't store those tables in the patched version. Or meybe it calculates some widths wrong, or maybe there's some other bug left in the patcher.
second: to disable d2d, you have to edit the config file with another editor while BP is not running. And make sure that there's only one [View] section and only one d2d entry below it. Just to make sure...