The font does not appear in the IntelliJ dialog to select the font

I installed the Monaco font using this code . However, it does not appear in Setting -> Editor -> Color and fonts -> Font. What should I do?

+4
source share
5 answers

Try installing the fonts differently. Just use the Font Viewer .

enter image description here

I use IDEA under ElementaryOS and it works for me.

Update:

enter image description here

+2
source

You need to create a folder monacoin the directory/usr/share/fonts/truetype/

and copy the font 'monaco.ttf' into this folder.

Then run fc-cache -v -f

+3
source

. , IDEA , .

~/.fonts, IDEA. .local/share/fonts fc-cache -v -f, , IDEA.

, .

enter image description here

+1

IntelliJ . , , IntelliJ. IDE ( , , ..), : UIManager.put("XXX.font", new Font("fontName", style, size)) XXX - , Label, TextField, Tree ..). Swing (IntelliJ Swing framework) : Java Swing? IntelliJ UI. :

import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;

import javax.swing.*;
import java.awt.*;

public class MyUIPlugin implements ToolWindowFactory
{

    private ToolWindow myToolWindow;

    public static final String TOOL_WINDOW_ID = "MyUISettings";

    public MyUIPlugin() {}

    // Create the tool window content.
    public void createToolWindowContent(final Project project, final ToolWindow toolWindow) {
        myToolWindow = toolWindow;
        this.createContent(toolWindow);
}

public void createContent(final ToolWindow toolWindow) {
    final ContentFactory contentFactory = toolWindow.getContentManager().getFactory();
    JLabel myPluginUI = new JLabel("This is empty panel with my custom fonts settings behind it");
    final Content content = contentFactory.createContent(myPluginUI, "", true);
    toolWindow.getContentManager().addContent(content);
    UIManager.put("TextField.font", new Font(...));
    UIManager.put("List.font", new Font(...));
    UIManager.put("Label.font", new Font(...));
    UIManager.put("Button.font", new Font(...));
    .....
    SwingUtilities.updateComponentTreeUI(myPluginUI);
}

}

, Swing JLabel placeholder, , , GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(). IntelliJ UI.

+1

Source: https://habr.com/ru/post/1530407/


All Articles