mazatech / amanithvg-sdk Goto Github PK
View Code? Open in Web Editor NEWAmanithVG SDK
License: Other
AmanithVG SDK
License: Other
make easier to use amanithvg in cmake projects
similar: vpxyz/ShivaVG#4
use case: im trying to link the ShivaVG examples to libAmanithVG.so
Hi,
Not a bug
Just request library for Apple M1
Thank you in Advance
When a string of text is drawn with vgDrawGlyphs, it seems to be reading the adjustment values from the wrong locations in the provided array. For character 0, it is not using any adjustment value, only using the position set to VG_GLYPH_ORIGIN. For character 1, it uses the adjustment value in adjustments[0].
To demonstrate, if I had the following code:
VGuint indices[strlen];
VGfloat x_adjustments[strlen];
VGfloat y_adjustments[strlen];
for (int i = 0; i < strlen; i++) {
/* Find computed values */
indices[i] = computed_index;
x_adjustments[i] = computed_x_adjustment;
y_adjustments[i] = computed_y_adjustment;
}
vgSetfv (VG_GLYPH_ORIGIN, 2, overall_origin);
vgDrawGlyphs (font,
strlen,
indices,
x_adjustments,
y_adjustments,
VG_FILL_PATH,
VG_FALSE);
I would have to change it to this for it to use the adjustment value on character 0 and the correct adjustments on the following characters:
VGuint indices[strlen];
VGfloat x_adjustments[strlen];
VGfloat y_adjustments[strlen];
for (int i = 0; i < strlen; i++) {
/* Find computed values */
indices[i] = computed_index;
x_adjustments[i] = computed_x_adjustment;
y_adjustments[i] = computed_y_adjustment;
}
VGfloat[2] new_overall_origin = {overall_origin[0] + x_adjustments[0], overall_origin[1] + y_adjustments[0]};
vgSetfv (VG_GLYPH_ORIGIN, 2, new_overall_origin);
vgDrawGlyphs (font,
strlen,
indices,
&x_adjustments[1],
&y_adjustments[1],
VG_FILL_PATH,
VG_FALSE);
However, the specification does seem somewhat ambiguous about this, as it says:
The user space position of the first glyph (the point where the glyph origin will be placed) is determined by the value of VG_GLYPH_ORIGIN.
Contrary to one possible interpretation of that, it seems that many applications written against OpenVG use vgDrawGlyphs adjustments as if the 0th value will be used.
Thank you for taking the time to read this. If I could provide any more information, please let me know.
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.