for (int i = 0; i < fontFamilies.getLength(); i++)
BaseFont candidateFont = fontMappingManager.getMappedFont( character, fontFamilies, fontStyle ); if (null == candidateFont)
	public boolean selectFont(char character) 	{		for (int i = 0; i < fontFamilies.getLength(); i++) 		{			if (!tried[i]) 			{				String fontFamilyName = fontFamilies.item(i).getCssText();				String mappedFontFamily = getMappedFontFamily(fontFamilyName);				bfs[i] = createFont(mappedFontFamily, getEncoding(mappedFontFamily));				tried[i] = true;			}			if (null != bfs[i] && bfs[i].charExists(character)) 			{				if (lastFontNameIndex == i)				{					isFontChanged = false;				}				else				{					isFontChanged = true;					bf = bfs[i];					lastFontNameIndex = i;				}				return true;			}		}		// get the user defined default font		String defaultFont = getMappedFontFamily("default"); //$NON-NLS-1$		if (!tried[tried.length - 2]) 		{			bfs[tried.length - 2] = createFont(defaultFont,getEncoding(defaultFont));			tried[tried.length - 2] = true;		}		if (null != bfs[tried.length - 2]				&& bfs[tried.length - 2].charExists(character)) 		{			if (lastFontNameIndex == tried.length - 2)			{				isFontChanged = false;			}else			{				isFontChanged = true;				bf = bfs[tried.length - 2];				lastFontNameIndex = tried.length - 2;			}			return true;		}					// If also failed, go to the last choice:		// We select a font family which is definitely in the user agent.		//So, we can make sure a font can be built; However, in this case we can 		//NOT ensure it is the appropriate one.		if (!tried[tried.length - 1]) 		{			bfs[tried.length - 1] = createFont(DEFAULT_FONT,getEncoding(DEFAULT_FONT));			tried[tried.length - 1] = true;		}		//if (null != bfs[tried.length - 1]) 		//It won't fail when trying to create a BaseFont with the DEFAULT_FONT.				if (bfs[tried.length - 1].charExists(character))		{			if (lastFontNameIndex == tried.length - 1)			{				isFontChanged = false;			}else			{				isFontChanged = true;				bf = bfs[tried.length - 1];				lastFontNameIndex = tried.length - 1;			}			return true;		}		else		{			if (null == bf)			{				isFontChanged = true;				bf = bfs[tried.length - 1];				lastFontNameIndex = tried.length - 1;			}else			{				isFontChanged = false;			}			return false;		}				}