mirror of
https://github.com/processing/processing4.git
synced 2026-02-04 06:09:17 +01:00
fixes for textFontNative, tests for launcher
This commit is contained in:
@@ -197,7 +197,8 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
|
||||
loaddir, loaddir, loaddir, loaddir,
|
||||
env_classpath);
|
||||
|
||||
//MessageBox(NULL, cp, "it's twoo! it's twoo!", MB_OK);
|
||||
//MessageBox(NULL, qtjava_path, "qtjava", MB_OK);
|
||||
//MessageBox(NULL, cp, "cp outgoing", MB_OK);
|
||||
|
||||
if (!SetEnvironmentVariable("CLASSPATH", cp)) {
|
||||
MessageBox(NULL, "Could not set CLASSPATH environment variable",
|
||||
|
||||
Binary file not shown.
@@ -1736,8 +1736,9 @@ public class PGraphics extends PImage implements PConstants {
|
||||
public void textFont(PFont which) {
|
||||
if (which != null) {
|
||||
textFont = which;
|
||||
textSize(which.size);
|
||||
textFontNative = which.font;
|
||||
textFontNativeMetrics = null;
|
||||
textSize(which.size);
|
||||
|
||||
} else {
|
||||
throw new RuntimeException("a null PFont was passed to textFont()");
|
||||
|
||||
@@ -679,20 +679,23 @@ public class PGraphics2 extends PGraphics {
|
||||
* will get recorded properly.
|
||||
*/
|
||||
public void textSize(float size) {
|
||||
// take care of setting the textSize and textLeading vars
|
||||
super.textSize(size);
|
||||
|
||||
// if a native version available, subset this font
|
||||
if (textFontNative != null) {
|
||||
textFontNative = textFontNative.deriveFont(size);
|
||||
g2.setFont(textFontNative);
|
||||
textFontNativeMetrics = g2.getFontMetrics(textFontNative);
|
||||
}
|
||||
|
||||
// take care of setting the textSize and textLeading vars
|
||||
// this has to happen second, because it calls textAscent()
|
||||
// (which requires the native font metrics to be set)
|
||||
super.textSize(size);
|
||||
}
|
||||
|
||||
|
||||
protected float textWidthImpl(char buffer[], int start, int stop) {
|
||||
if (textFontNative == null) {
|
||||
//System.out.println("native is null");
|
||||
return super.textWidthImpl(buffer, start, stop);
|
||||
}
|
||||
// maybe should use one of the newer/fancier functions for this?
|
||||
|
||||
@@ -54,7 +54,10 @@ _ and i don't want an additional "pathVertex()" function
|
||||
|
||||
_ "this file is named" errors don't like subdirectories
|
||||
_ need to strip off past the file separator or something
|
||||
|
||||
_ stop() not getting called
|
||||
_ http://dev.processing.org/bugs/show_bug.cgi?id=183
|
||||
_ major problem for libraries
|
||||
_ and start() is supposedly called by the applet viewer
|
||||
_ http://java.sun.com/j2se/1.4.2/docs/api/java/applet/Applet.html#start()
|
||||
_ need to track this stuff down a bit
|
||||
|
||||
Reference in New Issue
Block a user