Processing suggestion: make parseX(...) functions for all loadX(...) functions

So I have had this problem: Load custom font in Processing Android Core (made not in PDE) - Processing for Android - Processing Foundation
Im not asking for solving it now as I guess I have to resort to a workaround.
EDIT: I have found the solution, but my suggestion remains valid, these parseX functions might be beneficial for some.

Im asking for implementing parseX(…) functions for all loadX(…) functions that do something
So, for instance, loadImage(“img.png”) loads an image from img.png, converts it into PImage and returns it, right?
so parseImage(imageFileContents) would just parse the image from imageFileContents. You might also give it an extension, like parseImage(imageFileContents, “png”) or parseImage(imageFileContents, PNG).

So I’m in need of parseFont(…) because I CAN load a font contents, I cannot use loadFont or createFont because my in my particular case Processing-core either can’t find the file or can’t handle it.

Right now there are only parseX functions for JSON and XML stuff.

hi! I think you should submit an issue on the repository instead of posting here

or even on processing4

however, I think Processing is not actively adding new features at the moment. Your suggestion may be specific to your need and could be implemented as a separate library instead of adding to the core (correct me if I’m wrong - I mean I know certain people will definitely benefit but if you add all features like that, the core will blow up).

by the way I suggest writing parseXXX/loadXXX instead as X looks like a notation of x axis instead of wildcard at a glance :slight_smile:

1 Like

The parse xml and json does work because String is parsed.

You cannot compare this to image or font. Hence your suggestion is not valid.

You can make an image directly by the way. Use createImage or PGraphics.

I understand your problems with font though!! There is a tool in Menu Tools or somewhere to make fonts.
createFont also works very well. Maybe there is another issue like the font or the utf-8

Did you try other fonts?