WebStorm: Display ===, != operators as ≡, ≠ - webstorm

I'm looking for a setting/plugin which forces editor to display all occurences of multiple-char equality operators as their corresponding UTF-8 chars (≡, ≠...). I'm sure it is possible - I saw it on some screenshots from WebStorm. Does anyone know how to turn on this behaviour?

It's called font ligatures.
Settings/Preferences
Editor | Colors and Fonts
Enable font ligatures -- select this check box to show the typographic ligatures. Note that this feature depends on the selected fonts.
I could not find dedicated blog post for this new feature .. but you can find some notes here:
https://blog.jetbrains.com/webstorm/2016/06/webstorm-2016-2-eap-162-646/
https://blog.jetbrains.com/idea/2016/07/intellij-idea-2016-2-is-here/
video: https://youtu.be/Bjq-A4LCU9M?t=23m37s
Original ticket: https://youtrack.jetbrains.com/issue/IDEA-127539

Related

Substitute Wingding fonts for linux

I am using Java aspose.words and trying to build a pdf from docx/ppt in linux. The docx-document has an list with bulletpoints. These bulletpoints use the symbol font.
When i create the pdf with aspose these bulletpoints are shown in webdings font as a clapperboard.
I did not find any free font (for commercial use) that is an equivalent to the symbol font. Does anyone know a good solution to show correct bulletpoints in list?
I found the way to substitute fonts, but i don't know which font to use:
TableSubstitutionRule tableSubstitutionRule = fontSettings.getSubstitutionSettings().getTableSubstitution();
tableSubstitutionRule.addSubstitutes("Symbol", "?WHICH_FONT?");
It might be a known peculiarity. Windows “Symbol” font is a symbolic font (like “Webdings”, “Wingdings”, etc.) which uses Unicode PUA. Thus substitution of this font will cause different glyphs rendering. Provided Mac/Linux “Symbol” font on the other hand is a proper Unicode font (for example Greek characters are in the U+0370…U+03FF Greek and Coptic block). So these fonts are incompatible and Mac/Linux “Symbol” font cannot be used instead of Windows “Symbol” without additional actions. In this particular case you have to change the bullet codepoint from PUA U+F0B7 (or U+00B7 which also can be used in MS Word for symbolic fonts) to the U+2022 in the document to use the Mac “Symbol” font. See the following code for example:
Document doc = new Document("/Users/mac1/Downloads/in.docx");
for (com.aspose.words.List lst : doc.getLists())
{
for (com.aspose.words.ListLevel level : lst.getListLevels())
{
if (level.getFont().getName().equals("Symbol") && level.getNumberFormat().equals("\uF0B7"))
{
level.setNumberFormat("\u2022");
}
}
}
doc.save("/Users/mac1/Downloads/out.pdf");
If this does not help, please post your question in Aspose.Words support forum and attach your input and output document there.

How to check installed fonts styles?

I need a list of all installed fonts in the client machine (Always Windows) that contain the styles bold, italic and bold italic. Is there a function for that?
I'm already able to list all installed fonts with EnumFontFamiliesEx and i suppose that is possible to filter that list, but i'm looking for a "better way" :)
Thanks!
PS: I'm using C++ with MFC.
EDIT:
For fonts that doesn't have these styles Windows can "fake" that behavior (force a font look bold or italic), but i need to know which fonts really have these styles.
As you are using "EnumFontFamiliesEx",the call back function recieves the structure LOGFONT....
LOGFONT has two variables lfWeight and lfItalic.
Use those two variables to check if the enumerated font has style or not.
if lfWeight value is 0 (FW_DONTCARE) and lfItalic is false, you can consider this do not have any style.
Or if you want to be very specific, for example, you want to consider fonts with only Bold and Regular, then you can validate, if lfWeight has value from {400 (REGULAR), 600 (BOLD), 700 (BOLD), 800 (BOLD)}
Below link has all the details.
https://msdn.microsoft.com/en-us/library/windows/desktop/dd145037(v=vs.85).aspx

How to change indentation mode in Atom?

I haven't been able to figure this out yet. Atom seems to use spaces as the default indentation mode. I prefer to have tabs instead though. Sublime Text has built in functionality for switching and converting indentation.
Anyone found out how to change the indentation mode of Atom?
Some screenshots from Sublime Text:
See Soft Tabs and Tab Length under Settings > Editor Settings.
To toggle indentation modes quickly you can use Ctrl-Shift-P and search for Editor: Toggle Soft Tabs.
Go to File -> Settings
There are 3 different options here.
Soft Tabs
Tab Length
Tab Type
I did some testing and have come to these conclusions about what each one does.
Soft Tabs - Enabling this means it will use spaces by default (i.e. for new files).
Tab Length - How wide the tab character displays, or how many spaces are inserted for a tab if soft tabs is enabled.
Tab Type - This determines the indentation mode to use for existing files. If you set it to auto it will use the existing indentation (tabs or spaces). If you set it to soft or hard, it will force spaces or tabs regardless of the existing indentation. Best to leave this on auto.
Note: Soft = spaces, hard = tab
Add this to your ~/.atom/config.cson
editor:
tabLength: 4
OS X:
Go to Atom -> prefrences or CMD + ,
Scroll down and select "Tab Length" that you prefer.
You could try going to "Atom > Preferences > Editor" and set Tab length to 4.
This is for mac. For windows you will have to find the appropriate menu.
Adding #Manbroski answer here that worked for me:
try Ctrl-Shift-P Editor: Toggle Soft Tabs
Late to the party, but a clean way to do this on a per-project basis, is to add a .editorconfig file to the root of the project. Saves you from having to change Atom's settings when you're working on several projects simultaneously.
This is a sample of a very basic setup I'm currently using. Works for Atom, ST, etc...
http://editorconfig.org/
# Automatically add new line to end of all files on save.
[*]
insert_final_newline = true
# 2 space indentation for SASS/CSS
[*.{scss,sass,css}]
indent_style = space
indent_size = 2
# Set all JS to tab => space*2
[js/**.js]
indent_style = space
indent_size = 2
This is built into core: See Settings ⇒ Tab Type and choose auto:
When set to "auto", the editor auto-detects the tab type based on the contents of the buffer (it uses the first leading whitespace on a non-comment line), or uses the value of the Soft Tabs config setting if auto-detection fails.
You may also want to take a look at the Auto Detect Indentation package. From the docs:
Automatically detect indentation of opened files. It looks at each opened file and sets file specific tab settings (hard/soft tabs, tab length) based on the content of the file instead of always using the editor defaults.
You might have atom configured to use 4 spaces for tabs but open a rails project which defaults to 2 spaces. Without this package, you would have to change your tabstop settings globally or risk having inconsistent lead spacing in your files.
I just had the same problem, and none of the suggestions above worked. Finally I tried unchecking "Atomic soft tabs" in the Editor Settings menu, which worked.
If you are using the version 1.21.1:
Click on Packages / Settings View / Open
Select "Editor" on the left side panel
Scrool down until you see "Tab Length"
Edit the value. I like to set it to 4.
Now, just close the active tab pane and you are done.
Tab Control gives nice control in a similar manner to that described in your question.
Also nice, for JavaScript developers, is ESLint Tab Length for using ESLint config.
Or if you're using an .editorconfig for defining project-specific indentation rules, there is EditorConfig
If you're using Babel you may also want to make sure to update your "Language Babel" package. For me, even though I had the Tab Length set to 2 in my core editor settings, the Same setting in the Language Babel config was overriding it with 4.
Atom -> Preferences -> Packages -> (Search for Babel) -> Grammar -> Tab Length
Make sure the appropriate Grammar, There's "Babel ES6 Javascript Grammar", "language-babel-extension Grammar" as well as "Regular Expression". You probably want to update all of them to be consistent.
If global tab/spaces indentation settings no longer fit your needs (I.E. you find yourself working with legacy codebases with varied indentation formats, and you need to quickly switch between them, and the auto-detect isn't working) you might try the tab-control plugin, which sort of duplicates the functionality of the menu in your screenshot.
When Atom auto-indent-detection got it hopelessly wrong and refused to let me type a literal Tab character, I eventually found the 'Force-Tab' extension - which gave me back control.
I wanted to keep shift-tab for outdenting, so set ctrl-tab to insert a hard tab. In my keymap I added:
'atom-text-editor':
'ctrl-tab': 'force-tab:insert-actual-tab'
Changing language-specific configuration
I changed the default tab settings, and it still did not impact when I was editing my files, which were Python files. It also did not change when I modified the "*" setting in ~/.atom/config.cson . I don't have a good explanation for either of those.
However, when I added the following to my config.cson, I was able to change the tab in my Python files to 2 spaces:
'.source.python':
editor:
tabLength: 2
Thanks to this resource for the solution: Tab key not respecting tab length
All of the most popular answers on here are all great answers and will turn on spaces for tabs, but they are all missing one thing. How to apply the spaces instead of tabs to existing code.
To do this simply select all the code you want to format, then go to Edit->Lines->Auto Indent and it will fix everything selected.
Alternatively, you can just select all the code you want to format, then use Ctrl Shift P and search for Auto Indent. Just click it in the search results and it will fix everything selected.
Yet another answer: If you are using Atom Beautify note that it has its own settings to determine the "Indent Char".

xsl:fo - Add "z-index" to a text on top of an image

I have a problem.
I need to set some kind of z-index, like you can use on the web in HTML/CSS.
Because I have a text on an image, and therefore I want to be sure that it looks good when printing.
Is there some "z-index" code I can use on theese fo:block elements?
Thanks!
/Daniel
XSL-FO defines z-index property:
http://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#z-index
You have to check your formatting agent whether does support this property.

SketchFlow / SketchStyles is empty. ((Assets) Styles > SketchStyles)

I just installed the Expression Blend Studio 4 (Trial) from Microsoft.
I have several tutorials telling me to change the style, that I should go to
(Assets) Styles > SketchStyles
There is nothing under that area except a warning(and link)
This category shows all the styles you have created for the current document or application. Additional styles can be found in the online Expression Gallery.
That link gets me no where fast. It basically goes to the home page of Expression Blend.
If you look at this 90 second video.
http://electricbeach.org/files/sketchflow_overview.wmv
At the 30-36 second mark, he is switching the style from squiggly to something more professional.
I'm trying to demo that same thing, which I believe (keep in mind I'm new to this) I am changing FROM the WigglyStyles style to something else.
With
(Assets) Styles > SketchStyles
being empty, I don't know what I'm missing.
...........
So a 2 part question:
How do I get entries to show up under (Assets) Styles > SketchStyles?
(If different from #1), how do I change the overall style from WigglyStyles to something else (and back to WigglyStyles)?
Thanks!
Is misssing the SketchStyles.xaml.
SketchStyles.xaml – this file contain the resource dictionary with number of styles which SketchFlow project makes use of them internally.
Solution:
Create a new solution, a (sketchflow silverlight solution), copy the SketchStyles.xaml from your created solution drag and drop the to the project that doesn't have this file, and press ctrl+shift+B to build it.
hope it helped.
The message was throwing me off.
The little triangle, pointed "to the right" initially, has to be clicked (and then points down) exposing the sub items.
The message:
This category shows all the styles you have created for the current document or application. Additional styles can be found in the online Expression Gallery.
is what was throwing me off. (And I was thinking the same thing as alimbada, that my install went awry).
Once I expand "Styles" (via the small triangle), everything is there.
Ok!! Did I mention I'm a developer, not a designer?? (haha).
Aka, this was just a big "duh" moment.
Thanks.
I just had a quick play with Sketchflow since I have Blend installed and those styles show up fine. Maybe your install went awry?