public void setFont(Font font) { this.fontStr = font.getFontName() + addStyleName(font.getStyle()) + "-" + font.getSize(); }
protected void setFontSize(Component component, int fontSize) { Font oldFont = component.getFont(); Font newFont = new Font(oldFont.getFontName(), oldFont.getStyle(), fontSize); component.setFont(newFont); }
public static String[] GetAvailableFontNames() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] FontName = new String[fonts.length]; for ( int i = 0; i < fonts.length; i++ ) { FontName[i] = fonts[i].getFontName(); } return FontName; }
public static void printFonts() { final Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts(); for (Font f : fonts) { System.out.println("f=" + f + "/" + f.getPSName() + "/" + f.getName() + "/" + f.getFontName() + "/" + f.getFamily()); } final String name[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); for (String n : name) { System.out.println("n=" + n); } }
@Getter public String getFontName() { return getFont().getFontName(); }
String fontName = allFont.getFontName();
int pageWidth = unicodeFont.getGlyphPageWidth(); int pageHeight = unicodeFont.getGlyphPageHeight(); out.println("info face=\"" + font.getFontName() + "\" size=" + font.getSize() + " bold=" + (font.isBold() ? 1 : 0) + " italic=" + (font.isItalic() ? 1 : 0) + " charset=\"\" unicode=0 stretchH=100 smooth=1 aa=1 padding=" + unicodeFont.getPaddingTop() + "," + unicodeFont.getPaddingRight() + "," + unicodeFont.getPaddingBottom() + ","
int pageWidth = unicodeFont.getGlyphPageWidth(); int pageHeight = unicodeFont.getGlyphPageHeight(); out.println("info face=\"" + font.getFontName() + "\" size=" + font.getSize() + " bold=" + (font.isBold() ? 1 : 0) + " italic=" + (font.isItalic() ? 1 : 0) + " charset=\"\" unicode=0 stretchH=100 smooth=1 aa=1 padding=" + unicodeFont.getPaddingTop() + "," + unicodeFont.getPaddingRight() + "," + unicodeFont.getPaddingBottom() + ","
attList.add(new AttributedStringData(TextAttribute.FAMILY, fontMapped.getFontName(Locale.ROOT), beginIndex+partBegin, beginIndex+partEnd)); if (LOG.check(POILogger.DEBUG)) { LOG.log(POILogger.DEBUG, "mapped: ",fontMapped.getFontName(Locale.ROOT)," ",(beginIndex+partBegin)," ",(beginIndex+partEnd)," - ",runText.substring(beginIndex+partBegin, beginIndex+partEnd)); attList.add(new AttributedStringData(TextAttribute.FAMILY, fontFallback.getFontName(Locale.ROOT), beginIndex+partBegin, beginIndex+partEnd)); if (LOG.check(POILogger.DEBUG)) { LOG.log(POILogger.DEBUG, "fallback: ",fontFallback.getFontName(Locale.ROOT)," ",(beginIndex+partBegin)," ",(beginIndex+partEnd)," - ",runText.substring(beginIndex+partBegin, beginIndex+partEnd));
public Font getFont(String fontName) { for (Font f : fonts) { if (f.getFontName().equals(fontName)) return f; } return null; }
@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (label == null) return null; Font f = (Font) value; if (f == null) return label; label.setText(f.getFontName()); label.setFont(Theme.SMALL_BOLD_FONT); return label; } }
public void actionPerformed(ActionEvent e) { Font font = (Font) fontChooser.getSelectedItem(); if (font == null) return; setPortValue(font.getFontName()); }
protected void setFontSize(Component component, int fontSize) { Font oldFont = component.getFont(); Font newFont = new Font(oldFont.getFontName(), oldFont.getStyle(), fontSize); component.setFont(newFont); }
private static String getShortenedName(String name, int startChars) { nodebox.graphics.Text text = new nodebox.graphics.Text(name, nodebox.graphics.Point.ZERO); text.setFontName(Theme.NETWORK_FONT.getFontName()); text.setFontSize(Theme.NETWORK_FONT.getSize()); int cells = Math.min(Math.max(3, 1 + (int) Math.ceil(text.getMetrics().getWidth() / (GRID_CELL_SIZE - 6))), 6); if (cells > 3) return getShortenedName(name.substring(0, startChars) + "\u2026" + name.substring(name.length() - 3, name.length()), startChars - 1); return name; }
private String iconNameFor(Time time) { Font font = Canvas.defaultFont(); Dimension size = tray.iconSize(); String colorName = look.colors().getClass().getSimpleName(); return font.getFontName() + "_" + size.width + "x" + size.height + "_" + colorName + "_" + time.shortestString(); }
private void setGUISize() { jSplitPane0.setDividerSize(GUISizeHelper.dividerBarSize); jSplitPane1.setDividerSize(GUISizeHelper.dividerBarSize); jSplitPane2.setDividerSize(GUISizeHelper.dividerBarSize); stackObjects.setCardDimension(GUISizeHelper.handCardDimension); txtSpellsCast.setFont(new Font(GUISizeHelper.gameDialogAreaFont.getFontName(), Font.BOLD, GUISizeHelper.gameDialogAreaFont.getSize())); txtHoldPriority.setFont(new Font(GUISizeHelper.gameDialogAreaFont.getFontName(), Font.BOLD, GUISizeHelper.gameDialogAreaFont.getSize())); GUISizeHelper.changePopupMenuFont(popupMenuTriggerOrder); int newStackWidth = pnlHelperHandButtonsStackArea.getWidth() * GUISizeHelper.stackWidth / 100; if (newStackWidth < 410) { newStackWidth = 410; } Dimension newDimension = new Dimension(pnlHelperHandButtonsStackArea.getWidth() - newStackWidth, GUISizeHelper.handCardDimension.height + GUISizeHelper.scrollBarSize); handContainer.setPreferredSize(newDimension); handContainer.setMaximumSize(newDimension); newDimension = new Dimension(newStackWidth, STACK_MIN_CARDS_OFFSET_Y + GUISizeHelper.handCardDimension.height + GUISizeHelper.scrollBarSize); stackObjects.setPreferredSize(newDimension); stackObjects.setMinimumSize(newDimension); stackObjects.setMaximumSize(newDimension); newDimension = new Dimension(newStackWidth, (int) pnlShortCuts.getPreferredSize().getHeight()); pnlShortCuts.setPreferredSize(newDimension); pnlShortCuts.setMinimumSize(newDimension); pnlShortCuts.setMaximumSize(newDimension); }
private static void addStyle(String name, Color bg, Color fg, boolean bold, boolean italic) { SimpleAttributeSet style = new SimpleAttributeSet(); StyleConstants.setFontFamily(style, HelperUi.FONT_UBUNTU_MONO.getFontName()); StyleConstants.setFontSize(style, HelperUi.FONT_UBUNTU_MONO.getSize()); StyleConstants.setBackground(style, bg); StyleConstants.setForeground(style, fg); StyleConstants.setBold(style, bold); StyleConstants.setItalic(style, italic); styles.put(name, style); }
private BaseFont getCachedBaseFont(Font f) { synchronized (baseFonts) { BaseFont bf = baseFonts.get(f.getFontName()); if (bf == null) { bf = fontMapper.awtToPdf(f); baseFonts.put(f.getFontName(), bf); } return bf; } }
@Override public void setFont(Font font) { log.debug("Set font: "+font.getFontName()); }
protected void setFontSize(Component component, int fontSize) { Font oldFont = component.getFont(); Font newFont = new Font(oldFont.getFontName(), oldFont.getStyle(), fontSize); component.setFont(newFont); }