Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it run in Android Studio? #2

Open
ghost opened this issue Feb 3, 2019 · 0 comments
Open

Is it run in Android Studio? #2

ghost opened this issue Feb 3, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 3, 2019

I entered the code into the Android studio as follows, but an error occurs at runtime.
Is there anything wrong with me?

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import java.util.ArrayList;
import fontastic.FGlyph;
import fontastic.Fontastic;
import processing.core.PApplet;
import processing.core.PVector;

public class MainActivity extends AppCompatActivity{

private PApplet myParent;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);



    Fontastic f = new Fontastic(myParent,"a");

    f.setAuthor("test");
    PVector[] points = new PVector[4];              // Define a PVector array containing the points of the shape
    points[0] = new PVector(0, 0);                  // Start at bottom left
    points[1] = new PVector(512, 0);        // The normal width is 512, the normal height 1024
    points[2] = new PVector(512, 1024); // y coordinates are from bottom to top!
    points[3] = new PVector(0, 1024);
    f.addGlyph('A').addContour(points);

    f.buildFont();
}
}

error:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.fontastic/com.test.fontastic.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String processing.core.PApplet.dataPath(java.lang.String)' on a null object reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants