Different the width of whitespace in eclipse editor - eclipse

I set my editor use the whitespace only, but I got problem with the whitespace's width. The longer whitespace in blank lines, shorter in others. I have no idea how to configure it.

You are using a variable width font. Change it to a fixed width font like Courier New/Consolas/Monaco/Menlo (depending on your preferences)
Go to Eclipse->Preferences->General->Appearance->Colors and Fonts->Structured Text Editors->Structured Text Editor font and set it to a fixed width font

If you do want to use a variable width font, just make all those fonts/colors use the same size.
Monospaced fonts are only used because editors still don't support relatively recent inventions like elastic tabstops which results in the type of issue you highlight. That plus habit.
I personally find that variable width fonts look so much better and increase the readability so much that they're totally worth it.

Related

Display larger indentation for files that are indented with just two spaces

I'm working on a project that is using 2 spaces as indentation.
I have a hard time reading code with such small indentation, so my question is:
Question: Can I make vscode show the two spaces as if they were wider (for example double the width)?
(I could of course solve it in a hackish way, by converting each file on checkout, and convert it back before i commit it, but that would be very tedious and error prone. I could also try to convince the project to convert the whole project to tabs, so that everyone can use their own preferred indentation. But I don't want to go into that discussion for every project I work on :) )
I have written the extension Indent Whitespace that decorates each space used in indentation with additional spaces (cursor will skip the decoration).
The decorated spaces are colored with a very transparent red.
With a setting you can change the number of spaces to add, default 1.
If you delete spaces with Delete it looks funny because the selection does not change, use the Arrow keys to update the decorations.
In a later version I will make the decoration color a setting, and also only update the decoration when the file changes (only important for large files, and fix the delete-update rendering).
I think you can't.
There is no such setting in VS Code. As of version 1.13, you can change the kerning, but this changes the spacing between all characters. You cannot do this only for a single character (or a set of characters).
The space width is a property of the font. Microsoft has a guideline that defines what is the ideal space size for a font. But this does not mean you cannot change it yourself when designing one. So I created a version of Roboto Mono which space character is 4x the original one.
This works on Notepad and MS Word, we can see the space is quite big. However, using the exact same font in VS Code, the space is still small, independently of the font being monospaced or not.
Illustration
Somehow, it looks like VS Code ignores space size in the font and decides by itself what is the best value.

Configuring the font-style of VS Code's inlay-hints

How can I change the font's style for VS Code's "Inlay Hints" feature?
I attempted to search for an answer, but could only find how to change the color, not the style.
Here's an example:
I would like the word target in the image below to render italic.
I tried the following, however, it did not work...
{
scope: "inlayHint",
settings: {
fontStyle: "italic",
},
},
I also tried adding editor.inlayHint to the scope, but the attempt was without success.
Setting the Font-style to italic isn't Possible.
Not all is lost though, there's a workaround that actually works pretty well.
As I stated above, setting the font-style to italic is not possible. There is, however, a workaround, and it works pretty darn well. Before I explain the workaround, I think its important to note that the first solution I tried to use, was to set the font to an italic variant, unfortunately setting "editor.inlayHints.fontFamily" to an italic variant of a font was something that VS Code didn't seem to allow. I have seen this in many other situations. The idea is, since you can't do this "fontStyle": "italic", you just change the font to an italic version.
For example:
If I use Cascadia Code as my font, then — in theory — I can just us the following configuration:
// #file "settings.json"
{
"editor.inlayHints.fontFamily": "'Cascadia Code Italic'"
}
...however, it unfortunately doesn't work that way — or at-least not in this situation. Not only do italic varients not work, but neither do bold variants and/or expanded variants (i.e. 'Inconsolata SemiExpanded', 'Inconsolata Bold', etc...).
While moving forward, I will state the obvious:
There is no "editor.inlayHints.fontStyle" setting.
So what do we do?
Well we can set the font-family using "editor.inlayHints.fontFamily".
Its a bit suprising that we can set the font, but not the font's style. I am not sure why they designed it this way, but it's obvious that they built the feature with specific constraints for reasons that are beyond me (reading the feature's development feed on GitHub would probably help anyone who wanted to know more about why the feature works how it does). Nevertheless, we have a highly customizable setting, that actually gives us far more control than the setting that we established, does not exist, editor.inlayHints.font.
What I do, personally, which has a cool tricked-out look, is I find a
non-monospaced hand-written style of font — usually from Google Fonts — and I assign that to the font-family. It took me a while to find some fonts that work. Anyone who has ever played with fonts, trying to find which font works best for them to write code with, will know: Picking fonts that are used anywhere inside the editor (or inside your code) is going to require great scrutiny, and the longer you code, the more set in your ways you get, so this can actually be a time consuming setting to configure. It took me an hour to settle on a font, and I settled on using the "Sriracha" font-family. Siracha is oblique in appearance (looks italic), its readable in the editor, it renders well in the editor (which not all fonts are going to do), and its slightly bolder than the standard weight of the font I use wich is Cascadia Code.
My Configuration results in the following appearance:
When changing the font family, there are a couple other settings that help to configure this feature.
So, in other words, just do the following:
Download the italic &/or bold style font you wont from Google Fonts, Font Squirrel, or some other font source you perfer.
Set the font family using "editor.inlayHints.fontFamily".
Critique the fonts configuration using the other settings available below.
// #file "settings.json"
{
// Font Family
"editor.inlayHints.fontFamily": "/*NAME OF FONT FAMILY*/",
// Font Size
"editor.inlayHints.fontSize": 14, // <-- Set the font-size you want
// Theme Colors Override
"workbench.colorCustomizations": {
// Overrides Theme Default Colors for InlayHints feature
"editorInlayHint.background": "#00001CCC",
"editorInlayHint.foreground": "#99FFBBCC",
// Overrides Theme Parameter hints fg for InlayHints feature
"editorInlayHint.parameterBackground": "#00001CCC",
"editorInlayHint.parameterForeground": "#99FFBBCC",
// Overrides Theme Type hints fg for InlayHints feature
"editorInlayHint.typeBackground": "#08000088",
"editorInlayHint.typeForeground": "#DDEEFF88"
},
}
Really its quite simple.
By being able to set the inlayHints font family to anything we want, we can achieve any sort of font style we want.
In settings.json you need a line like
"editor.inlayHints.fontFamily": "'Myfontitalic'",
Now, it seems vscode has some trouble reading a font name with non alphanumeric characters, if for instance the italic version is "Myfont-Italic" or "Myfont Italic".
A solution is to copy and rename the font to a new name, like "Myfontitalic", without spaces or other characters.
What I did was for Ubuntu but the same idea should work on any Linux, and probably Windows, using other tools (fontforge?)
apt install fonttools font-manager to get ttx a utility to change font info (font-manager is also useful)
use a search, font-manager, font-viewer, ... to find the location of the font (usually /usr/share/fonts/... or ~/.local/share/fonts)
copy a fresh version somewhere (home), cp ~/.local/share/fonts/Myfont-Italic.otf ~/temp.otf and cd to go home
translate to an XML copy ttx temp.otf as temp.ttx
edit temp.ttx (vi, ...), and change all "Myfont-Italic", "Myfont Italic" ... (relevant names) to a unique "Myfontitalic" name, save.
translate back to otf (...) with ttx temp.ttx (creates Myfontitalic.otf if it was an otf file)
To install the new font (locally), either double-click on it in the file explorer ( ~/Myfontitalic.otf ) or use a tool. Restart font-manager, the new font should be visible.
Restart vscode and add the line above in settings.json.
on a Mac find the font variant name like this:
Open "Font Book" App
Expand the desired font and select a variant.
Click the (i) icon on the Font Book toolbar.
Use the PostScript Name name in VS Code - for example "editor.inlayHints.fontFamily": "DankMono-Italic"
No one tells you where to edit this and that makes it a pain in the butt.
File>Preferences>Settings, search for color customizations, click "Edit in settings.json"
{
"workbench.colorCustomizations": {
"editorInlayHint.background": "#00000000",
"editorInlayHint.foreground": "#666666FF",
},
}

Fillable Pdf multi-line, Allow rich text formatting in Acrobat Pro DC: but it ignores line spacing/leading set in More

I'm on Win10, using Acrobat Pro DC 2021.011... to edit and Reader DC (same version) to test.
From experience and from reading forums etc, forms in these apps are maddening... but I have not been able to find any discussion (or solutions) to the following behavior...
The form I'm building for other employees' use has a large edit text box set to Multi-line and Allow Rich Text Formatting. It is set to a default font, Calibri and size 50pt. For most situations this will work for them; provides 2-3 lines for a short product description. But occasionally they want a smaller font and more lines... They know how to get the ctrl+e properties bar. But in my testing of this alternative situation they'll need sometimes, I'm finding it's impossible to get the smaller font size and more lines to work. Here's my process.
tab into text box. Ctrl+E for properties bar.
before typing I set the font size to 24
then I type in my 4 lines of text
then I tab to my next form field...
and kaboom... the field I just filled...it's line height is so large it's pushed some of the content invisible. I assume this is coming from the field's default font size, 50
And if I try to adjust the line height, by selecting all the text and then choosing in More...>Form Field Text Properties>Paragraph>Line Spacing
If I set it to Single and click Close/click into another field I get the very large leading (presumably for 50pt font (same as pic above after point 5)
If I choose Exactly and set to point size slightly larger, click Close/out of field, I get another ridiculous result where the 2/3 line have the height I set, but the space between the 1 & 2 second line is way too much and the space between the last line and 3rd line is way too small...
before tabbing or clicking out of field to another field
Good lord.. what is that! 3 different leading values in the same field; just after applying 1 value to all lines, all text in the field...
It makes no sense... it doesn't look like it regards your input at all, and just comes up with it's own random leading... I've fiddled with Space before/after and combinations of Line Height and nothing comes close to what we need... At this point I'm convinced the Acrobat tools for a stylizing text in a multi-line, allow formatting text field are useless. I'd be better off with my employees they can't format anything, ever. Just type one line and hit Tab or Enter...
What is going on! I'm trying to make a simple fillable form for other employees to use, but this kind of behavior makes that impossible (It's enough of a stretch to teach them to use the ctrl+E and do some styling of their text but this is bonkers and completely unteachable... there's not rhyme or pattern to teach!)
Hope someone can help or has seen this behavior too.

Alignment of characters in Notepad++

I just wondered why my m-files from MATLAB look so different when I open them with Notepad++ instead of the built-in MATLAB Editor.
It seems that in the MATLAB Editor each character has the same width. Not so in Notepad++ (even I change the language to "M").
Here's a screenshot from a file opened in Notepad++ (left) and in the MATLAB Editor (right).
In the MATLAB Editor all the characters in column X are exactly one below the other. They aren't in Notepad++.
I just played a bit with the tab preferences, without any success.
Is there a way to get the alignment of columns in Notepad++ the same as in the MATLAB Editor ...at least for m-files?
It's because your MATLAB Editor is set to use a monospaced font such as Courier (i.e. a font where all the characters are designed to have exactly the same width), but your Notepad++ is not.
In Notepad++, you can set the font with the menu Settings -> Style Configurator. Select "MATLAB" from the language list (or in fact you may like to select "Global Styles", to do this for all languages), and set the font to a monospaced font such as Courier.
Alternatively, you may like to download a more modern programming font such as Consolas, ProFont, Monofur, Proggy, or Inconsolata. These are all monospaced, and nicer than Courier. You can use the in both Notepad++ and the MATLAB Editor.
It's possible that another issue might be that you have tab characters in your code, which are displaying with a variable width in Notepad++. You can make sure that MATLAB replaces tab characters with spaces in the MATLAB preferences (MATLAB->Editor/Debugger/Tab). To check whether you have tab characters, open the file in Notepad++ and select View->Show Symbol->Show All Characters. Tab characters will display as a short arrow, and space characters will display as a little dot. If you need to change all the tabs to spaces in an existing file, Notepad++ can do this with Edit->Blank Operations->Tab to Space.
Hope that helps!
To add to Sam's answer, choosing a monospaced font specific to your environment's language is recommended. For instance, Courier New on Japanese language may not have the desired result. Choose MS Gothic (for Windows) or Osaka (for Mac) instead.

Plone - TinyMCE editor - line breaks with double instead single line spacing

We are using Plone 4.1.3 and the default TinyMCE editor. When we press the Enter key in TinyMCE, it produces a double line spacing instead of single line. We found a few similar questions and answers on this issue in the forum but don't know and cannot find the TinyMCE configuration file to modify to make line break into single line spacing. There is also nothing in Site Setup or ZMI to configure this for TinyMCE.
We found this the forum but it is not pertaining to plone.
Decrease the line spacing in TinyMCE textarea
Thank you very much in anticipation
cmgui
CSS. These are just paragraph elements (<p> tags). -- style them!
http://plone.293351.n2.nabble.com/TinyMCE-Plone-4-customizing-the-styles-for-own-CSS-classes-td5954678.html
As sdupton pointed out, this is indeed on purpose; enter is supposed to be a paragraph break, and behaves the same way in applications like Word. You can insert line breaks by shift-enter, but it's not encouraged to do that on the web, since text flows differently depending on font size and window size (and OS!).
If you want paragraphs to have less spacing, use CSS to reduce the margin/padding.