behdad / glyphy Goto Github PK
View Code? Open in Web Editor NEWGLyphy is a signed-distance-field (SDF) text renderer using OpenGL ES2 shading language.
License: Other
GLyphy is a signed-distance-field (SDF) text renderer using OpenGL ES2 shading language.
License: Other
Should break at cusp and convert resulting curves separately.
High-DIP (i.e. Macbook Retina Pro) still draws at standard resolution.
At least just in the readme, say what shaders in the demo are organized, etc, and included a few comparison pictures.
Export the gallery somewhere as well!
Hi.Yeah,I added your fixes to demo-font.cc but now it fails several lines down after
" if (endpoints.size ())" safety statement you added.
It fails in demo-font.cc here:
if (!glyphy_arc_list_encode_blob (&endpoints[0], endpoints.size (),
buffer,
buffer_len,
faraway / SCALE,
4, /* UNUSED */
&avg_fetch_achieved,
output_len,
nominal_width,
nominal_height,
extents)){
die ("Failed encoding arcs");
}
with the same issue as above - endpoints[0] has size of zero.I tried to wrap it with size check as you did but in this case the program exists silently .
I build in windows visual studio and vcpkg
but compile error: “hb.h”: No such file or directory
I also install harfbuzz yet
Please help that What I can do
A while back I got emscription demo going again. Unfortunately the HTML wrapper does not handle retina displays, so it looks bad on such devices. And it's not sexy like http://wdobbie.com/pdf/ but thought I just put a link here in case someone wants to give it some love.
http://behdad.github.io/glyphy-emscripten/glyphy-demo.html
I should write up instructions for compiling.
Glyphy has glyphy_arc_accumulator_cubic_to and glyphy_arc_accumulator_conic_to.
The cubic_to method is as expected, it creates a cubic Bézier segment.
The conic_to method however, just creates a quadratic Bézier, not a rational quadratic one, as the name would suggest.
Is it possible with glyphy to skew text so it can be placed into a 3D secene? If so, it would be a nice feature to have a skewing option in the demo.
Cheers
Ben
Have you ever tried to port it to DirectX + HLSL?
I integrated it to my DX/OGL rendering engine. OGL+GLSL works just fine but DX+HLSL renders some glyphs (not all) with some artifacts.
Copying comments from the Google Code bug, just for future reference:
Reported by kcconley, Oct 30, 2012
Add support to skip demo and its dependencies during 'configure' and to not build demo when running 'make'.
Nov 1, 2012 Delete comment Project Member #1 behdad.esfahbod
Fair enough. However, the dependencies shouldn't pose a build fail. If you don't mind me asking, what''s the primary reason you need this?
Nov 1, 2012 Delete comment #2 kcconley
I built glyphy for iOS. I just needed to link to libglyphy. I refactored (hacked) the demo to run on iOS (without GLUT). The repo version of demo won't build because GLUT doesn't exist on iOS.
BTW. Demo runs SLOW on my iPod 3G. ~3 FPS
Nov 1, 2012 Delete comment #3 [email protected]
Interesting. If you have patches of the changes I'd be happy to take them.
Nov 1, 2012 Delete comment #4 kcconley
I'd be happy to give it to you. But its kind of an embarassing mess right now. I just wanted to see the performance so I spent an hour or so getting it running. I have an Xcode project which is more or less a hacked version of the demo files and some platform-specific stuff. I have it linking to libglyphy which I am building from the command-line. Nothing that resembles a 'patch' at this point.
Nov 1, 2012 Delete comment #5 [email protected]
Right. That's what I expected. Would be interesting to see the number on iPhone 5. I'm more interested seeing numbers on Android, and have not got the time to port yet.
Nov 1, 2012 Delete comment #6 kcconley
I will try it on the 4S this weekend. Was hoping it would be faster than it was. Its too heavy in the fragment shader. I would like to make it faster. :-/ You guys working on any major speed improvements?
Nov 1, 2012 Delete comment Project Member #7 behdad.esfahbod
I'm not actively working on it right now, but may do next year. However, most of my ideas involve reducing texture fetches in exchange of more work in the fragment shader :(. The thing is, I don't have a test environment that is weak on the shader operations, so I can't test any change.
On my two testing machines (ThinkPad T530, and Macbook Air), the demo runs at over 60fps fullscreen...
Nov 1, 2012 Delete comment #8 kcconley
You can simply try to render the demo geometry X times per frame. Increase X until the framerate drops to like 20 fps or something.
Dec 6, 2012 Delete comment #9 [email protected]
So, any chance you can run this on an iPhone5?
The case that all points are colinear needs special care. Though it's very low priority in fonts.
There is a way in your library to set the display coordinates to render a text at a specific position, or to set the font size directly (without scaling the projection matrix)?.
On the file glyphs-demo.cc I tried to change the coordinates of glyphy_point_t top_left for example to:
glyphy_point_t top_left = {100, 50}; demo_buffer_move_to (buffer, &top_left);
But the text is still render in the same position.
At the function demo_buffer_add_text
the fourth parameter should be the font size, but f.e. if you change the size from 1 to f.e.:
demo_buffer_add_text (buffer, text, font, 100);
there is no any difference with demo_buffer_add_text (buffer, text, font, 1);
Of course if I scale the projection matrix it grows.
Is this a bug, or what is the purpose for both parameter ?
What should the demo look like?
I can see no discernible text in it. Just lines tightly packed together.
Is this how it /should/ look?
The website http://www.glyphy.org/ which is linked in the project description, is currently unavailable.
Another issue I encountered a couple of weeks ago trying to build the lib on Mac OS X Maverick.;
These steps:
Compilation instructions on Mac OS X:
don't work.
I installed MacPorts but command (3) just doesn't work.It always complains about pkgconfig missing.
Not really using Mac but maybe you will want to revise the make script .
The abort occurs in process_contour. Interestingly, the version here:
https://www.fontsquirrel.com/fonts/liberation-mono
works ok. I didn't investigate the lineage.
Might be a simple patch to libGLUT. Or maybe upstream has added already, not sure.
Making the Android demo useful will be great.
Hi, please write a iOS demo, think you
What's the current status of glyphy? It seems like with Vulkan becoming a useful API, things should be easier to deal with now.
Thanks.
i have attempted to port this to use with QT 6 Framework but i currently get a white screen with no text
https://github.com/mgood7123/Qt_Glyphy_CMAKE
https://github.com/mgood7123/Qt_Glyphy_CMAKE/blob/main/GLWindow.cpp
would this be a bug in the glyph rendering or in the font file?
make && ./demo/glyphy-demo -t "{" -f /System/Library/Fonts/Times.ttc
this does not seem to happen in other font files
tho some fonts render a square such as /System/Library/Fonts/Keyboard.ttf
./demo/glyphy-demo -t "1234567890-=q\`wertyuiop[]\asdfghjkl;\'zxcvbnm,./~!@#$%^&*()_+{}|:\"<>?QWERTYUIOPASDFGHJKLZXCVBNM" -f /System/Library/Fonts/Keyboard.ttf
i am trying to port glyphy to OpenGL 3 (OpenGL 3.2 context) with #version 330 core
and #version 320 es
and i currently get no text rendered
it seems like the default GL context glew creates is 2.1 INTEL-14.7.8
(2.1
) tho this might vary
these are my current changes https://github.com/mgood7123/glyphy-opengl3/commit/0104d65f225afa993ef0af3ea3ff135661fe3dc0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.