Git Product home page Git Product logo

jiconfont's Introduction

jIconFont

jIconFont is a API to provide icons generated from any IconFont. These icons can be used in Java GUI toolkits, such as Swing and JavaFX.

Visit http://jiconfont.github.io/

LICENSE

jIconFont is distributed under the terms of the MIT license. See LICENSE file for details.

jiconfont's People

Contributors

caduandrade avatar

Stargazers

Bardia Namjoo avatar Link-Kou avatar  avatar Griefed avatar Edik avatar  avatar .gz avatar Grzegorz Nowak avatar Stanislav Poslavsky avatar Bekir Mavuş avatar Fathy AR avatar K。Ken avatar Alessandro Falappa avatar Tácio Silva Diogo avatar Brett Stevenson avatar Ghazi Bouabene avatar Jorge Alexandre Delesderrier da Silva avatar

Watchers

James Cloos avatar  avatar

Forkers

iant89

jiconfont's Issues

Icons not getting antialiased / appearing blurry

There appears to be alot of distortion and artifacts when using small icons in JLabels and JButtons.
Here is the code I am using to test this:

import com.formdev.flatlaf.FlatDarculaLaf;
import jiconfont.icons.font_awesome.FontAwesome;
import jiconfont.swing.IconFontSwing;

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

public class Main {
    public static void main(String[] args) throws UnsupportedLookAndFeelException {
//        LookAndFeel laf = new NimbusLookAndFeel();
        LookAndFeel laf = new FlatDarculaLaf();
        UIManager.setLookAndFeel(laf);
        UIManager.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        UIManager.put("useSystemAAFontSettings", "on");
        UIManager.put("swing.aatext", "true");
        System.setProperty("awt.useSystemAAFontSettings","on");
        System.setProperty("swing.aatext", "true");
        UIManager.getDefaults().put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

        IconFontSwing.register(FontAwesome.getIconFont());

        JFrame frame = new JFrame("Test Window");
        JPanel content = new JPanel(new BorderLayout());

        JButton button = new JButton("Hello");
        button.setPreferredSize(new Dimension(100, 50));
        button.setIcon(IconFontSwing.buildIcon(FontAwesome.ARROW_LEFT, 40));
        content.add(button, BorderLayout.CENTER);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setContentPane(content);
        frame.pack();
        frame.setVisible(true);
    }
}

This doesn't seem to work on Windows 10. I am using Jiconfont to create the icons from FontAwesome . This issue seems to be present regardless of the LookAndFeel.

This is the result I am getting, where the anti aliasing is not working on the icons:
image
image
image

modular (Java 9) version

Using more than one icon set in the same modular project is not possible because the package "jiconfont.icons" is split between the different projects (assuming one wants to put all the jars in the module path and use them as "automatic modules"). One solution could be to change package declaration in each one of the icon set projects, while keeping the overall structure of jiconfont non modular; otherwise, make jiconfont modular.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.