protected String calculateLabel(FacesContext context, Avatar component) {
        String value = component.getLabel();
        if (value == null || value.length() <= 2) {
            return value;
        }
        Matcher m = LETTER_PATTTERN.matcher(value);
        StringBuilder sb = SharedStringBuilder.get(context, SB_AVATAR);
        while (m.find()) {
            sb.append(m.group());
        }
        String initials = sb.toString();
        initials = LangUtils.isEmpty(initials) ? value.charAt(0) + "" : initials;
        return initials.length() == 1 ? initials : initials.charAt(0) + initials.substring(initials.length() - 1);
    }
Generates a label based on the text if its more than 2 characters. Example: PrimeFaces Rocks = PR

@param component the Avatar component
@return the calculated label text.
primefaces/src/main/java/org/primefaces/component/avatar/AvatarRenderer.java