Returns a reference to the requested typeface, creating a new instance if none already exists

@param context the current context
@param iconSet the icon typeface
@return a reference to the typeface instance
973077
public static Typeface getTypeface(Context context, IconSet iconSet) {
        String path = iconSet.fontPath().toString();

        if (TYPEFACE_MAP.get(path) == null) {
            final Typeface font = Typeface.createFromAsset(context.getAssets(), path);
            TYPEFACE_MAP.put(path, font);
        }
        return TYPEFACE_MAP.get(path);
    }
1245457
protected IContext makeContext()
	{
		final HttpCallContext http = HttpCallContext.peek();

		if (http != null)
		{
			return new WebContext(http.getRequest(), http.getResponse(), http.getServletContext(), http.getRequest().getLocale());
		}
		else
		{
			return new Context();
		}
	}
247750
public IConceptSet lookupConcept(int r) {
        if (r >= data.length) {
            return IConceptSet.EMPTY_SET;
        }

        if (null == data[r]) {
            return IConceptSet.EMPTY_SET;
        } else {
            return new ReadonlyConceptSet(data[r]);
        }
    }
801277
public void init(Icon icon, String text)
    {
        this.setText(text);
        this.setIcon(icon);
        this.setMargin(JScreenConstants.NO_INSETS);
    }
686922
private String resolveFontPath(Context context, AttributeSet attrs) {
        // Try view xml attributes
        String textViewFont = CalligraphyUtils.pullFontPathFromView(context, attrs, mAttributeId);

        // Try view style attributes
        if (TextUtils.isEmpty(textViewFont)) {
            textViewFont = CalligraphyUtils.pullFontPathFromStyle(context, attrs, mAttributeId);
        }

        // Try View TextAppearance
        if (TextUtils.isEmpty(textViewFont)) {
            textViewFont = CalligraphyUtils.pullFontPathFromTextAppearance(context, attrs, mAttributeId);
        }

        return textViewFont;
    }
541525
public T typeface(final String name) {
        if (view != null)
            typeface(getTypeface(name, context));
        return self();
    }
537357
private static Typeface getTypeface(final String name, final Context context) {
        Typeface typeface = TYPEFACES.get(name);
        if (typeface == null) {
            typeface = Typeface.createFromAsset(context.getAssets(), name);
            TYPEFACES.put(name, typeface);
        }
        return typeface;
    }
1164218
def _icon_by_painter(self, painter, options):
        """"""
        engine = CharIconEngine(self, painter, options)
        return QIcon(engine)
1306227
private static IconSet resolveIconSet(String iconCode) {
        CharSequence unicode;

        for (IconSet set : getRegisteredIconSets()) {

            if (set.fontPath().equals(FontAwesome.FONT_PATH) || set.fontPath().equals(Typicon.FONT_PATH) || set.fontPath().equals(MaterialIcons.FONT_PATH)) {
                continue; // already checked previously, ignore
            }

            unicode = set.unicodeForKey(iconCode);

            if (unicode != null) {
                return set;
            }
        }

        String message = String.format("Could not find FontIcon value for '%s', " +
                "please ensure that it is mapped to a valid font", iconCode);

        throw new IllegalArgumentException(message);
    }
8052
public View setTypeface(Context context, @LayoutRes int layoutRes, String typefaceName, int style) {
		return setTypeface(context, layoutRes, null, typefaceName, 0);
	}
769912
@NonNull
    public IconicsDrawable iconOffsetYRes(@DimenRes int sizeResId) {
        return iconOffsetYPx(mContext.getResources().getDimensionPixelSize(sizeResId));
    }
1295246
@NonNull
    public IconicsDrawable iconOffsetXPx(@Dimension(unit = PX) int sizePx) {
        mIconOffsetX = sizePx;

        invalidateSelf();
        return this;
    }
201632
private static int fontStyleToInt(FontStyle style) {
        switch (style) {
        case PLAIN:
            return java.awt.Font.PLAIN;
        case BOLD:
            return java.awt.Font.BOLD;
        case ITALIC:
            return java.awt.Font.ITALIC;
        default:
            return java.awt.Font.PLAIN;
        }
    }
1125764
private static Font lookupDefaultDialogFont() {
        Font buttonFont = UIManager.getFont("Button.font");
        return buttonFont != null
                ? buttonFont
                : new JButton().getFont();
    }
597753
def icon(self):
        
        if isinstance(self._icon, str):
            if QtGui.QIcon.hasThemeIcon(self._icon):
                return QtGui.QIcon.fromTheme(self._icon)
            else:
                return QtGui.QIcon(self._icon)
        elif isinstance(self._icon, tuple):
            return QtGui.QIcon.fromTheme(self._icon[0],
                                         QtGui.QIcon(self._icon[1]))
        elif isinstance(self._icon, QtGui.QIcon):
            return self._icon
        return QtGui.QIcon()
877741
public static void styleEditable(@NonNull Context ctx,
                                     @Nullable HashMap<String, ITypeface> fonts,
                                     @NonNull Editable textSpanned,
                                     @Nullable List<CharacterStyle> styles,
                                     @Nullable HashMap<String, List<CharacterStyle>> stylesFor) {
        fonts = init(ctx, fonts);

        //find all icons which should be replaced with the iconFont
        List<StyleContainer> styleContainers = IconicsUtils.findIconsFromEditable(textSpanned, fonts);

        //set all the icons and styles
        IconicsUtils.applyStyles(ctx, textSpanned, styleContainers, styles, stylesFor);
    }
778675
private Icon getSynthIcon(AbstractButton b, int synthConstant) {
        return style.getIcon(getContext(b, synthConstant), getPropertyPrefix() + "icon");
    }