-
Notifications
You must be signed in to change notification settings - Fork 14
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
MarkupText creating invisible SVG files #44
Comments
While trying out the same with |
I'm not sure I get what you mean, but having white as the default color is expected, see |
I thought black was the default color? Is there any problems on changing the default text color to black? Or is it a bug in Pango? |
Default color for |
That's fine. I am considering the SVG file here, would there be any problems? Also, I can't reproduce this in C. #include <cairo.h>
#include <cairo-svg.h>
#include <math.h>
#include <pango/pangocairo.h>
#define WIDTH 600
#define HEIGHT 400
#define TEXT "Hello"
int
main (void)
{
cairo_surface_t* surface;
cairo_t* cr;
PangoFontDescription* font_desc;
PangoLayout* layout;
double width_layout = WIDTH;
double font_size_c= 1;
const char * filename="test.svg";
surface = cairo_svg_surface_create (filename,WIDTH, HEIGHT);
cr = cairo_create (surface);
cairo_move_to(cr,20,20);
layout = pango_cairo_create_layout(cr);
pango_layout_set_width(layout, pango_units_from_double(width_layout));
font_desc = pango_font_description_new();
pango_font_description_set_size(font_desc, pango_units_from_double(font_size_c));
pango_font_description_set_style(font_desc, PANGO_STYLE_ITALIC);
pango_font_description_set_weight(font_desc, PANGO_WEIGHT_BOLD);
pango_layout_set_font_description(layout, font_desc);
pango_font_description_free(font_desc);
cairo_move_to(cr,30,20);
pango_cairo_update_layout(cr,layout);
pango_layout_set_markup(layout, TEXT, -1);
pango_cairo_show_layout(cr, layout);
cairo_destroy (cr);
cairo_surface_destroy (surface);
g_object_unref(layout);
return 0;
} I think we are doing something wrong and because of that we get white coloured texts. |
I cannot currently compile the above code on my machine due to some linking error / library path issue. But IIRC it will yield black text, no? I don't know whether we are doing something wrong, but white seems to be a sensible choice for the default color over at Manim. The white color in the SVG created by instantiating a |
You can compile it with
Yes, it did, I attach the file, test.svg
Oh!, you are forcing white on it, I see. |
No luck. Must be some other problem, probably related to gcc/clang on OS X.
Actually, forcing it to whatever the user chose as their preferred color. This is because we do not set the color to the |
If you tell me what are the error I can help, or you can use meson here 😉, I uploaded a zip file with meson configuration to compile run: pip install meson ninja
meson builddir --prefix='$PWD/prefix'
meson compile -C builddir this should create an executable in |
This is the error message:
I still think it is related to some Xcode / clang / gcc issue on OS X. It might work with Homebrew's gcc and build system. |
I think I got no idea on how to, sorry. |
FWIW, I was able to build it with |
Oh, this is because of a different shell and isn't about GCC. Essentially, |
No, it's not about the shell. Backticks or
vs.
vs.
The missing symbols were namely
which must have been due to the missing |
Looks like my fault sorry. It needs to be |
I really don't know why this happens but running
MarkupText
creates an SVG file which when viewed in browser is invisible.The file size isn't less but I could see it has
where the
fill:rgb(100%,100%,100%)
means white and this makes the text invisible.Example Code
And the file
media/texts/87d6c8ec25c88f0b.svg
should be created, which when opened on browser is invisible.My Pango and Cairo version are
Is this expected @PhilippImhof ?
The text was updated successfully, but these errors were encountered: