Conversation
|
The included code creates there four corners of the bounding box that the glyph is going to render into - it is very essential. The macro This bit of code accomplishes the task of telling the shaders which glyph to draw and where. You could accomplish this same task without the complicated packing (albeit with higher bandwidth) simply by using a uniform buffer object with struct encoded |
|
Thanks both. To me, what's in demo/ is the simplest working demo. But sure, if you can provide something that is easier to understand for others, I'll merge that. |
|
Thanks for the info @alexzielenski, I'll have another read of the @behdad, with utmost respect I think you've misread my intention. I'm not trying to write another demo of Glyphy's capabilities (as you mention the code in The point of this for me would be, on the first hand, to figure out how I can use Glyphy and on the second to act as documentation for other programmers who are interested in experimenting with the project. I've updated the title of the PR to be more representative of what's inside! |
|
This is obviously a 4 year old issue, and probably not of much use anymore to you, but in case others come by and want to see an example of integration, we did integrate Glyphy into GTK 4 on a branch a few months back which might serve as an example. https://gitlab.gnome.org/GNOME/gtk/-/tree/glyphy2
|
Hello,
I'm trying to get an example together that does the bare minimum to demonstrate how to use the Glyphy library and the SDF shader that is bundled. In broad strokes, I'd like to write a small program that simply:
I've got some of the way there in this PR, but have got a bit stuck reading the demo code to figure out what to do next. I've got 1. & 2. running nicely, but don't understand what's going on in this code
glyphy/demo/demo-shader.cc
Lines 78 to 88 in 77bd0c2
I'm not a C expert, but I'm guessing it has to do with rendering the extents in the main demo to visualise Glyphy's optimisations, which the general user wouldn't use just to render the glyph?
In any case, I would love some feedback on what I have here and what I should write next to get 3. and 4. working!
Cheers,
Ben