Called from textFont. Check the validity of args and print possible errors to the user before calling this. Subclasses will want to override this one. @param which font to set, not null @param size size to set, greater than zero
(PFont which, float size)
| 4395 | * @param size size to set, greater than zero |
| 4396 | */ |
| 4397 | protected void textFontImpl(PFont which, float size) { |
| 4398 | textFont = which; |
| 4399 | // if (hints[ENABLE_NATIVE_FONTS]) { |
| 4400 | // //if (which.font == null) { |
| 4401 | // which.findNative(); |
| 4402 | // //} |
| 4403 | // } |
| 4404 | /* |
| 4405 | textFontNative = which.font; |
| 4406 | |
| 4407 | //textFontNativeMetrics = null; |
| 4408 | // changed for rev 0104 for textMode(SHAPE) in opengl |
| 4409 | if (textFontNative != null) { |
| 4410 | // TODO need a better way to handle this. could use reflection to get |
| 4411 | // rid of the warning, but that'd be a little silly. supporting this is |
| 4412 | // an artifact of supporting java 1.1, otherwise we'd use getLineMetrics, |
| 4413 | // as recommended by the @deprecated flag. |
| 4414 | textFontNativeMetrics = |
| 4415 | Toolkit.getDefaultToolkit().getFontMetrics(textFontNative); |
| 4416 | // The following is what needs to be done, however we need to be able |
| 4417 | // to get the actual graphics context where the drawing is happening. |
| 4418 | // For instance, parent.getGraphics() doesn't work for OpenGL since |
| 4419 | // an OpenGL drawing surface is an embedded component. |
| 4420 | // if (parent != null) { |
| 4421 | // textFontNativeMetrics = parent.getGraphics().getFontMetrics(textFontNative); |
| 4422 | // } |
| 4423 | |
| 4424 | // float w = font.getStringBounds(text, g2.getFontRenderContext()).getWidth(); |
| 4425 | } |
| 4426 | */ |
| 4427 | |
| 4428 | handleTextSize(size); |
| 4429 | } |
| 4430 | |
| 4431 | |
| 4432 | /** |
no test coverage detected