@NonNull
    private static BitmapDrawable getEmojiDrawableHelper(final EmojiPaint paint, final int emoji) {
        final Bitmap bm = Bitmap.createBitmap(paint.bitmapDimensions.first, paint.bitmapDimensions.second, Bitmap.Config.ARGB_8888);
        final Canvas canvas = new Canvas(bm);
        if (emoji >= CUSTOM_ICONS_START && emoji <= CUSTOM_ICONS_END) {
            final int radius = paint.availableSize / 2;
            final Paint cPaint = new Paint();

            // calculate circle details
            final int v = emoji - CUSTOM_ICONS_START_CIRCLES;
            final int aIndex = v / (COLOR_VALUES * COLOR_VALUES * COLOR_VALUES);
            final int rIndex = (v / (COLOR_VALUES * COLOR_VALUES)) % COLOR_VALUES;
            final int gIndex = (v / COLOR_VALUES) % COLOR_VALUES;
            final int bIndex = v % COLOR_VALUES;

            final int color = Color.argb(
                    255 - (aIndex * OPACITY_SPREAD),
                    COLOR_OFFSET + rIndex * COLOR_SPREAD,
                    COLOR_OFFSET + gIndex * COLOR_SPREAD,
                    COLOR_OFFSET + bIndex * COLOR_SPREAD);
            cPaint.setColor(color);
            cPaint.setStyle(Paint.Style.FILL);
            canvas.drawCircle((int) (paint.bitmapDimensions.first / 2), (int) (paint.bitmapDimensions.second / 2) - paint.offsetTop, radius, cPaint);
        } else {
            final String text = getEmojiAsString(emoji);
            final TextPaint tPaint = new TextPaint();
            if (emoji > NUMBER_END || emoji < NUMBER_START) {
                tPaint.setTextSize(paint.fontsize);
            } else {
                // increase display size of numbers
                tPaint.setTextSize(paint.fontsize * 1.4f);
            }
            final StaticLayout lsLayout = new StaticLayout(text, tPaint, paint.availableSize, Layout.Alignment.ALIGN_CENTER, 1, 0, false);
            canvas.translate((int) ((paint.bitmapDimensions.first - lsLayout.getWidth()) / 2), (int) ((paint.bitmapDimensions.second - lsLayout.getHeight()) / 2) - paint.offsetTop);
            lsLayout.draw(canvas);
            canvas.save();
            canvas.restore();
        }
        return new BitmapDrawable(paint.res, bm);
    }
builds a drawable the size of a marker with a given text

@param paint - paint data structure for Emojis
@param emoji codepoint of the emoji to display
@return drawable bitmap with text on it
main/src/main/java/cgeo/geocaching/utils/EmojiUtils.java