mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-127539 Support for ligatures in editor
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -44,8 +44,10 @@ public class FontPreferences {
|
||||
@NotNull private final TObjectIntHashMap<String> myFontSizes = new TObjectIntHashMap<String>();
|
||||
@NotNull private final List<String> myEffectiveFontFamilies = ContainerUtilRt.newArrayList();
|
||||
@NotNull private final List<String> myRealFontFamilies = ContainerUtilRt.newArrayList();
|
||||
|
||||
private boolean myUseLigatures;
|
||||
|
||||
@Nullable Runnable myChangeListener;
|
||||
@Nullable private Runnable myChangeListener;
|
||||
|
||||
/**
|
||||
* Font size to use by default. Default value is {@link #DEFAULT_FONT_SIZE}.
|
||||
@@ -169,6 +171,7 @@ public class FontPreferences {
|
||||
preferences.myFontSizes.put(fontFamily, myFontSizes.get(fontFamily));
|
||||
}
|
||||
}
|
||||
preferences.myUseLigatures = myUseLigatures;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -189,6 +192,8 @@ public class FontPreferences {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (myUseLigatures != that.myUseLigatures) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -227,6 +232,19 @@ public class FontPreferences {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean useLigatures() {
|
||||
return myUseLigatures;
|
||||
}
|
||||
|
||||
public void setUseLigatures(boolean useLigatures) {
|
||||
if (useLigatures != myUseLigatures) {
|
||||
myUseLigatures = useLigatures;
|
||||
if (myChangeListener != null) {
|
||||
myChangeListener.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
+23
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -98,6 +98,8 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme {
|
||||
@NonNls private static final String CONSOLE_LINE_SPACING = "CONSOLE_LINE_SPACING";
|
||||
@NonNls private static final String EDITOR_FONT_SIZE = "EDITOR_FONT_SIZE";
|
||||
@NonNls private static final String CONSOLE_FONT_SIZE = "CONSOLE_FONT_SIZE";
|
||||
@NonNls private static final String EDITOR_LIGATURES = "EDITOR_LIGATURES";
|
||||
@NonNls private static final String CONSOLE_LIGATURES = "CONSOLE_LIGATURES";
|
||||
@NonNls private static final String EDITOR_QUICK_JAVADOC_FONT_SIZE = "EDITOR_QUICK_DOC_FONT_SIZE";
|
||||
|
||||
protected AbstractColorsScheme(EditorColorsScheme parentScheme) {
|
||||
@@ -430,6 +432,14 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme {
|
||||
FontSize value = myValueReader.read(FontSize.class, childNode);
|
||||
if (value != null) myQuickDocFontSize = value;
|
||||
}
|
||||
else if (EDITOR_LIGATURES.equals(name)) {
|
||||
Boolean value = myValueReader.read(Boolean.class, childNode);
|
||||
if (value != null) myFontPreferences.setUseLigatures(value);
|
||||
}
|
||||
else if (CONSOLE_LIGATURES.equals(name)) {
|
||||
Boolean value = myValueReader.read(Boolean.class, childNode);
|
||||
if (value != null) myConsoleFontPreferences.setUseLigatures(value);
|
||||
}
|
||||
}
|
||||
|
||||
private int readFontSize(Element element, boolean isDefault) {
|
||||
@@ -484,7 +494,8 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme {
|
||||
else {
|
||||
writeFontPreferences(EDITOR_FONT, parentNode, myFontPreferences);
|
||||
}
|
||||
|
||||
writeLigaturesPreferences(parentNode, myFontPreferences, EDITOR_LIGATURES);
|
||||
|
||||
if (!myFontPreferences.equals(myConsoleFontPreferences)) {
|
||||
if (myConsoleFontPreferences.getEffectiveFontFamilies().size() <= 1) {
|
||||
element = new Element(OPTION_ELEMENT);
|
||||
@@ -502,6 +513,7 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme {
|
||||
else {
|
||||
writeFontPreferences(CONSOLE_FONT, parentNode, myConsoleFontPreferences);
|
||||
}
|
||||
writeLigaturesPreferences(parentNode, myConsoleFontPreferences, CONSOLE_LIGATURES);
|
||||
}
|
||||
|
||||
if (getConsoleLineSpacing() != getLineSpacing()) {
|
||||
@@ -539,6 +551,15 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme {
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeLigaturesPreferences(Element parentNode, FontPreferences preferences, String optionName) {
|
||||
if (preferences.useLigatures()) {
|
||||
Element element = new Element(OPTION_ELEMENT);
|
||||
element.setAttribute(NAME_ATTR, optionName);
|
||||
element.setAttribute(VALUE_ELEMENT, String.valueOf(true));
|
||||
parentNode.addContent(element);
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeFontPreferences(@NotNull String key, @NotNull Element parent, @NotNull FontPreferences preferences) {
|
||||
for (String fontFamily : preferences.getRealFontFamilies()) {
|
||||
Element element = new Element(key);
|
||||
|
||||
+5
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -135,6 +135,10 @@ class ValueElementReader {
|
||||
//noinspection unchecked
|
||||
return (T)(toEnum((Class<Enum>)type, value));
|
||||
}
|
||||
if (Boolean.class.equals(type)) {
|
||||
//noinspection unchecked
|
||||
return (T)Boolean.valueOf(value);
|
||||
}
|
||||
throw new IllegalArgumentException("unsupported " + type);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.intellij.application.options.colors;
|
||||
|
||||
import com.intellij.application.options.OptionsConstants;
|
||||
import com.intellij.ide.BrowserUtil;
|
||||
import com.intellij.ide.ui.AntialiasingType;
|
||||
import com.intellij.ide.ui.UISettings;
|
||||
import com.intellij.openapi.application.ApplicationBundle;
|
||||
@@ -30,6 +31,8 @@ import com.intellij.ui.FontComboBox;
|
||||
import com.intellij.ui.FontInfoRenderer;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.ui.components.labels.LinkLabel;
|
||||
import com.intellij.ui.components.labels.LinkListener;
|
||||
import com.intellij.util.EventDispatcher;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
@@ -37,11 +40,14 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.*;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
public class FontOptions extends JPanel implements OptionsPanel{
|
||||
private static final FontInfoRenderer RENDERER = new FontInfoRenderer() {
|
||||
@@ -59,6 +65,8 @@ public class FontOptions extends JPanel implements OptionsPanel{
|
||||
@NotNull private final JTextField myLineSpacingField = new JTextField(4);
|
||||
private final FontComboBox myPrimaryCombo = new FontComboBox();
|
||||
private final JCheckBox myUseSecondaryFontCheckbox = new JCheckBox(ApplicationBundle.message("secondary.font"));
|
||||
private final JCheckBox myEnableLigaturesCheckbox = new JCheckBox(ApplicationBundle.message("use.ligatures"));
|
||||
private final JLabel myLigaturesInfoLinkLabel;
|
||||
private final FontComboBox mySecondaryCombo = new FontComboBox();
|
||||
|
||||
@NotNull private final JBCheckBox myOnlyMonospacedCheckBox =
|
||||
@@ -93,6 +101,18 @@ public class FontOptions extends JPanel implements OptionsPanel{
|
||||
SwingConstants.LEFT), "newline, sx 5");
|
||||
add(myUseSecondaryFontCheckbox, "newline, ax right");
|
||||
add(mySecondaryCombo, "sgx b");
|
||||
JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
|
||||
myEnableLigaturesCheckbox.setBorder(null);
|
||||
panel.add(myEnableLigaturesCheckbox);
|
||||
myLigaturesInfoLinkLabel = new LinkLabel<Void>(ApplicationBundle.message("ligatures.more.info"), null, new LinkListener<Void>() {
|
||||
@Override
|
||||
public void linkSelected(LinkLabel aSource, Void aLinkData) {
|
||||
BrowserUtil.browse("https://confluence.jetbrains.com/display/IDEADEV/Support+for+Ligatures+in+Editor");
|
||||
}
|
||||
});
|
||||
myLigaturesInfoLinkLabel.setBorder(new EmptyBorder(0, 5, 0, 0));
|
||||
panel.add(myLigaturesInfoLinkLabel);
|
||||
add(panel, "newline, sx 2");
|
||||
|
||||
myOnlyMonospacedCheckBox.setBorder(null);
|
||||
myUseSecondaryFontCheckbox.setBorder(null);
|
||||
@@ -194,6 +214,12 @@ public class FontOptions extends JPanel implements OptionsPanel{
|
||||
}
|
||||
}
|
||||
});
|
||||
myEnableLigaturesCheckbox.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
getFontPreferences().setUseLigatures(myEnableLigaturesCheckbox.isSelected());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private int getFontSizeFromField() {
|
||||
@@ -279,6 +305,10 @@ public class FontOptions extends JPanel implements OptionsPanel{
|
||||
myEditorFontSizeField.setEnabled(!readOnly);
|
||||
myUseSecondaryFontCheckbox.setEnabled(!readOnly);
|
||||
|
||||
myEnableLigaturesCheckbox.setEnabled(!readOnly);
|
||||
myLigaturesInfoLinkLabel.setEnabled(!readOnly);
|
||||
myEnableLigaturesCheckbox.setSelected(fontPreferences.useLigatures());
|
||||
|
||||
myIsInSchemeChange = false;
|
||||
}
|
||||
|
||||
|
||||
+30
-17
@@ -44,7 +44,7 @@ public class ComplementaryFontsRegistry {
|
||||
private static final List<String> ourFontNames;
|
||||
private static final Map<String, Pair<String, Integer>[]> ourStyledFontMap = new HashMap<String, Pair<String, Integer>[]>();
|
||||
private static final LinkedHashMap<FontKey, FontInfo> ourUsedFonts;
|
||||
private static FontKey ourSharedKeyInstance = new FontKey("", 0, 0);
|
||||
private static FontKey ourSharedKeyInstance = new FontKey("", 0, 0, false);
|
||||
private static FontInfo ourSharedDefaultFont;
|
||||
private static final TIntHashSet ourUndisplayableChars = new TIntHashSet();
|
||||
private static boolean ourOldUseAntialiasing;
|
||||
@@ -89,14 +89,16 @@ public class ComplementaryFontsRegistry {
|
||||
}
|
||||
|
||||
private static class FontKey {
|
||||
public String myFamilyName;
|
||||
public int mySize;
|
||||
public int myStyle;
|
||||
private String myFamilyName;
|
||||
private int mySize;
|
||||
private int myStyle;
|
||||
private boolean myUseLigatures;
|
||||
|
||||
public FontKey(@NotNull String familyName, final int size, @JdkConstants.FontStyle int style) {
|
||||
public FontKey(@NotNull String familyName, final int size, @JdkConstants.FontStyle int style, boolean useLigatures) {
|
||||
myFamilyName = familyName;
|
||||
mySize = size;
|
||||
myStyle = style;
|
||||
myUseLigatures = useLigatures;
|
||||
}
|
||||
|
||||
public boolean equals(final Object o) {
|
||||
@@ -105,6 +107,7 @@ public class ComplementaryFontsRegistry {
|
||||
|
||||
if (mySize != fontKey.mySize) return false;
|
||||
if (myStyle != fontKey.myStyle) return false;
|
||||
if (myUseLigatures != fontKey.myUseLigatures) return false;
|
||||
return myFamilyName.equals(fontKey.myFamilyName);
|
||||
}
|
||||
|
||||
@@ -112,6 +115,9 @@ public class ComplementaryFontsRegistry {
|
||||
int result = myFamilyName.hashCode();
|
||||
result = 29 * result + mySize;
|
||||
result = 29 * result + myStyle;
|
||||
if (myUseLigatures) {
|
||||
result = 29 * result + 1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -185,11 +191,12 @@ public class ComplementaryFontsRegistry {
|
||||
public static FontInfo getFontAbleToDisplay(int codePoint, @JdkConstants.FontStyle int style, @NotNull FontPreferences preferences) {
|
||||
boolean tryDefaultFont = true;
|
||||
List<String> fontFamilies = preferences.getEffectiveFontFamilies();
|
||||
boolean useLigatures = preferences.useLigatures();
|
||||
FontInfo result;
|
||||
//noinspection ForLoopReplaceableByForEach
|
||||
for (int i = 0, len = fontFamilies.size(); i < len; ++i) { // avoid foreach, it instantiates ArrayList$Itr, this traversal happens very often
|
||||
final String fontFamily = fontFamilies.get(i);
|
||||
result = doGetFontAbleToDisplay(codePoint, preferences.getSize(fontFamily), style, fontFamily);
|
||||
result = doGetFontAbleToDisplay(codePoint, preferences.getSize(fontFamily), style, fontFamily, useLigatures);
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
@@ -200,12 +207,12 @@ public class ComplementaryFontsRegistry {
|
||||
size = preferences.getSize(fontFamilies.get(0));
|
||||
}
|
||||
if (tryDefaultFont) {
|
||||
result = doGetFontAbleToDisplay(codePoint, size, style, FontPreferences.DEFAULT_FONT_NAME);
|
||||
result = doGetFontAbleToDisplay(codePoint, size, style, FontPreferences.DEFAULT_FONT_NAME, useLigatures);
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
result = doGetFontAbleToDisplay(codePoint, size, style);
|
||||
result = doGetFontAbleToDisplay(codePoint, size, style, useLigatures);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Fallback font: " + result.getFont().getFontName());
|
||||
}
|
||||
@@ -214,15 +221,16 @@ public class ComplementaryFontsRegistry {
|
||||
|
||||
@NotNull
|
||||
public static FontInfo getFontAbleToDisplay(int codePoint, int size, @JdkConstants.FontStyle int style, @NotNull String defaultFontFamily) {
|
||||
FontInfo result = doGetFontAbleToDisplay(codePoint, size, style, defaultFontFamily);
|
||||
FontInfo result = doGetFontAbleToDisplay(codePoint, size, style, defaultFontFamily, false);
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
return doGetFontAbleToDisplay(codePoint, size, style);
|
||||
return doGetFontAbleToDisplay(codePoint, size, style, false);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static FontInfo doGetFontAbleToDisplay(int codePoint, int size, @JdkConstants.FontStyle int originalStyle, @NotNull String defaultFontFamily) {
|
||||
private static FontInfo doGetFontAbleToDisplay(int codePoint, int size, @JdkConstants.FontStyle int originalStyle,
|
||||
@NotNull String defaultFontFamily, boolean useLigatures) {
|
||||
synchronized (lock) {
|
||||
@JdkConstants.FontStyle int style = originalStyle;
|
||||
if (Patches.JDK_MAC_FONT_STYLE_DETECTION_WORKAROUND && style > 0 && style < 4) {
|
||||
@@ -236,6 +244,7 @@ public class ComplementaryFontsRegistry {
|
||||
ourSharedKeyInstance.myStyle == style &&
|
||||
ourSharedKeyInstance.myFamilyName != null &&
|
||||
ourSharedKeyInstance.myFamilyName.equals(defaultFontFamily) &&
|
||||
ourSharedKeyInstance.myUseLigatures == useLigatures &&
|
||||
ourSharedDefaultFont != null &&
|
||||
( codePoint < 128 ||
|
||||
ourSharedDefaultFont.canDisplay(codePoint)
|
||||
@@ -247,12 +256,13 @@ public class ComplementaryFontsRegistry {
|
||||
ourSharedKeyInstance.myFamilyName = defaultFontFamily;
|
||||
ourSharedKeyInstance.mySize = size;
|
||||
ourSharedKeyInstance.myStyle = style;
|
||||
ourSharedKeyInstance.myUseLigatures = useLigatures;
|
||||
|
||||
FontInfo defaultFont = ourUsedFonts.get(ourSharedKeyInstance);
|
||||
if (defaultFont == null) {
|
||||
defaultFont = new FontInfo(defaultFontFamily, size, style, originalStyle);
|
||||
defaultFont = new FontInfo(defaultFontFamily, size, style, originalStyle, useLigatures);
|
||||
ourUsedFonts.put(ourSharedKeyInstance, defaultFont);
|
||||
ourSharedKeyInstance = new FontKey("", 0, 0);
|
||||
ourSharedKeyInstance = new FontKey("", 0, 0, false);
|
||||
}
|
||||
|
||||
ourSharedDefaultFont = defaultFont;
|
||||
@@ -266,22 +276,25 @@ public class ComplementaryFontsRegistry {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static FontInfo doGetFontAbleToDisplay(int codePoint, int size, @JdkConstants.FontStyle int style) {
|
||||
private static FontInfo doGetFontAbleToDisplay(int codePoint, int size, @JdkConstants.FontStyle int style, boolean useLigatures) {
|
||||
synchronized (lock) {
|
||||
if (ourUndisplayableChars.contains(codePoint)) return ourSharedDefaultFont;
|
||||
|
||||
final Collection<FontInfo> descriptors = ourUsedFonts.values();
|
||||
for (FontInfo font : descriptors) {
|
||||
if (font.getSize() == size && font.getStyle() == style && font.canDisplay(codePoint)) {
|
||||
if (font.getSize() == size &&
|
||||
font.getStyle() == style &&
|
||||
font.areLigaturesEnabled() == useLigatures &&
|
||||
font.canDisplay(codePoint)) {
|
||||
return font;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < ourFontNames.size(); i++) {
|
||||
String name = ourFontNames.get(i);
|
||||
FontInfo font = new FontInfo(name, size, style);
|
||||
FontInfo font = new FontInfo(name, size, style, style, useLigatures);
|
||||
if (font.canDisplay(codePoint)) {
|
||||
ourUsedFonts.put(new FontKey(name, size, style), font);
|
||||
ourUsedFonts.put(new FontKey(name, size, style, useLigatures), font);
|
||||
ourFontNames.remove(i);
|
||||
return font;
|
||||
}
|
||||
|
||||
@@ -6369,6 +6369,7 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
preferences.setUseLigatures(delegatePreferences == null ? false : delegatePreferences.useLigatures());
|
||||
}
|
||||
|
||||
private void reinitFontsAndSettings() {
|
||||
|
||||
@@ -47,27 +47,33 @@ public class FontInfo {
|
||||
|
||||
private static final boolean USE_ALTERNATIVE_CAN_DISPLAY_PROCEDURE = SystemInfo.isAppleJvm && Registry.is("ide.mac.fix.font.fallback");
|
||||
private static final FontRenderContext DUMMY_CONTEXT = new FontRenderContext(null, false, false);
|
||||
private static final boolean ENABLE_OPTIONAL_LIGATURES = Registry.is("editor.enable.optional.ligatures");
|
||||
|
||||
private final TIntHashSet mySymbolsToBreakDrawingIteration = new TIntHashSet();
|
||||
|
||||
private final Font myFont;
|
||||
private final int mySize;
|
||||
@JdkConstants.FontStyle private final int myStyle;
|
||||
private final boolean myUseLigatures;
|
||||
private final TIntHashSet mySafeCharacters = new TIntHashSet();
|
||||
private FontMetrics myFontMetrics = null;
|
||||
private boolean myHasGlyphsToBreakDrawingIteration;
|
||||
private boolean myCheckedForProblemGlyphs;
|
||||
|
||||
public FontInfo(final String familyName, final int size, @JdkConstants.FontStyle int style) {
|
||||
this(familyName, size, style, style);
|
||||
this(familyName, size, style, false);
|
||||
}
|
||||
|
||||
FontInfo(final String familyName, final int size, @JdkConstants.FontStyle int style, @JdkConstants.FontStyle int realStyle) {
|
||||
public FontInfo(final String familyName, final int size, @JdkConstants.FontStyle int style, boolean useLigatures) {
|
||||
this(familyName, size, style, style, useLigatures);
|
||||
}
|
||||
|
||||
FontInfo(final String familyName, final int size,
|
||||
@JdkConstants.FontStyle int style, @JdkConstants.FontStyle int realStyle, boolean useLigatures) {
|
||||
mySize = size;
|
||||
myStyle = style;
|
||||
myUseLigatures = useLigatures;
|
||||
Font font = new Font(familyName, style, size);
|
||||
myFont = ENABLE_OPTIONAL_LIGATURES ? getFontWithLigaturesEnabled(font, realStyle) : font;
|
||||
myFont = useLigatures ? getFontWithLigaturesEnabled(font, realStyle) : font;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -269,4 +275,25 @@ public class FontInfo {
|
||||
public int getStyle() {
|
||||
return myStyle;
|
||||
}
|
||||
|
||||
public boolean areLigaturesEnabled() {
|
||||
return myUseLigatures;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
FontInfo fontInfo = (FontInfo)o;
|
||||
|
||||
if (!myFont.equals(fontInfo.myFont)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return myFont.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -214,7 +214,7 @@ abstract class LineLayout {
|
||||
}
|
||||
}
|
||||
FontInfo fontInfo = ComplementaryFontsRegistry.getFontAbleToDisplay(codePoint, fontStyle, fontPreferences);
|
||||
if (currentFontInfo == null || !fontInfo.getFont().equals(currentFontInfo.getFont())) {
|
||||
if (!fontInfo.equals(currentFontInfo)) {
|
||||
addTextFragmentIfNeeded(chunk, text, currentIndex, i, currentFontInfo, fontRenderContext, run.isRtl());
|
||||
currentFontInfo = fontInfo;
|
||||
currentIndex = i;
|
||||
|
||||
@@ -526,6 +526,8 @@ action.apply.editor.font.settings=Apply editor font settings
|
||||
checkbox.show.only.monospaced.fonts=Show only monospaced fonts
|
||||
primary.font=Primary font:
|
||||
secondary.font=Secondary font:
|
||||
use.ligatures=Enable font ligatures
|
||||
ligatures.more.info=more info
|
||||
editbox.enter.tag.name=Enter tag name:
|
||||
title.tag.name=Tag Name
|
||||
title.xml=XML
|
||||
|
||||
@@ -565,10 +565,6 @@ editor.zero.latency.typing.description=Display single-line changes immediately (
|
||||
editor.zero.latency.typing.debug=false
|
||||
editor.zero.latency.typing.debug.description=Make 1 second pauses after immediate painting
|
||||
|
||||
editor.enable.optional.ligatures=false
|
||||
editor.enable.optional.ligatures.description=Enables optional ligatures supported by font in use
|
||||
editor.enable.optional.ligatures.restartRequired=true
|
||||
|
||||
decompiler.use.line.mapping=true
|
||||
decompiler.use.line.mapping.description=Maps original to decompiled line numbers when stepping in debugger.
|
||||
decompiler.dump.original.lines=false
|
||||
@@ -714,4 +710,4 @@ idea.io.safe.sync=true
|
||||
idea.io.safe.sync.description=When "Safe Write" is enabled, sync() is invoked after the last write to flush data to disk
|
||||
|
||||
dumb.aware.run.configurations=false
|
||||
dumb.aware.run.configurations.description=Enable executing run configurations in dumb mode
|
||||
dumb.aware.run.configurations.description=Enable executing run configurations in dumb mode
|
||||
Reference in New Issue
Block a user