EAPI RGBA_Font_Glyph *evas_common_font_int_cache_glyph_get (RGBA_Font_Int *fi, FT_UInt index);
/* load */
-
+EAPI void evas_common_font_dpi_set (int dpi);
EAPI RGBA_Font_Source *evas_common_font_source_memory_load (const char *name, const void *data, int data_size);
EAPI RGBA_Font_Source *evas_common_font_source_load (const char *name);
EAPI int evas_common_font_source_load_complete (RGBA_Font_Source *fs);
static int font_cache_usage = 0;
static int font_cache = 0;
+static int font_dpi = 75;
static Eina_Hash * fonts_src = NULL;
static Eina_Hash * fonts = NULL;
fonts_src = NULL;
}
+EAPI void
+evas_common_font_dpi_set(int dpi)
+{
+ font_dpi = dpi;
+}
+
EAPI RGBA_Font_Source *
evas_common_font_source_memory_load(const char *name, const void *data, int data_size)
{
FT_Activate_Size(fi->ft.size);
}
fi->real_size = fi->size * 64;
- error = FT_Set_Char_Size(fi->src->ft.face, 0, fi->real_size, 75, 75);
+ error = FT_Set_Char_Size(fi->src->ft.face, 0, fi->real_size, font_dpi, font_dpi);
if (error)
{
fi->real_size = fi->size;
{
Evas_GL_X11_Window *win;
int end;
+
+ XrmDatabase xrdb; // xres - dpi
+ struct { // xres - dpi
+ int dpi; // xres - dpi
+ } xr; // xres - dpi
};
static void *
e->engine.data.output = NULL;
return 0;
}
-
+
+ {
+ int status;
+ char *type = NULL;
+ XrmValue val;
+
+ re->xr.dpi = 75000; // dpy * 1000
+ re->xrdb = XrmGetDatabase(info->info.display);
+ status = XrmGetResource(re->xrdb, "Xft.dpi", "Xft.Dpi", &type, &val);
+ if ((status) && (type))
+ {
+ if (!strcmp(type, "String"))
+ {
+ const char *str, *dp;
+
+ str = val.addr;
+ dp = strchr(str, '.');
+ if (!dp) dp = strchr(str, ',');
+
+ if (dp)
+ {
+ int subdpi, len, i;
+ char *buf;
+
+ buf = alloca(dp - str + 1);
+ strncpy(buf, str, dp - str);
+ buf[dp - str] = 0;
+ len = strlen(dp + 1);
+ subdpi = atoi(dp + 1);
+
+ if (len < 3)
+ {
+ for (i = len; i < 3; i++) subdpi *= 10;
+ }
+ else if (len > 3)
+ {
+ for (i = len; i > 3; i--) subdpi /= 10;
+ }
+ re->xr.dpi = atoi(buf) * 1000;
+ }
+ else
+ re->xr.dpi = atoi(str) * 1000;
+ }
+ }
+ evas_common_font_dpi_set(re->xr.dpi / 1000);
+ }
+
evas_common_cpu_init();
-
+
evas_common_blend_init();
evas_common_image_init();
evas_common_convert_init();
# include <X11/Xatom.h>
# include <X11/Xutil.h>
# include <X11/extensions/Xrender.h>
-//// this changed. this was the old style. above the new style
-//# include <EGL/egl.h>
-//# include <GLES/gl.h>
-//# include <X11/Xlib.h>
-//# include <X11/Xatom.h>
-//# include <X11/Xutil.h>
-//# include <X11/extensions/Xrender.h>
+# include <X11/Xresource.h> // xres - dpi
# elif defined(GLES_VARIETY_SGX)
# define SUPPORT_X11 1
# include <EGL/egl.h>
# include <X11/Xatom.h>
# include <X11/Xutil.h>
# include <X11/extensions/Xrender.h>
-# endif
+# include <X11/Xresource.h> // xres - dpi
+#endif
# else
# include <GL/glx.h>
# include <X11/Xlib.h>
# include <X11/Xatom.h>
# include <X11/Xutil.h>
# include <X11/extensions/Xrender.h>
+# include <X11/Xresource.h> // xres - dpi
# include <GL/gl.h>
# include <GL/glext.h>
# include <GL/glx.h>
Tilebuf *tb;
Tilebuf_Rect *rects;
Tilebuf_Rect *cur_rect;
+
+ XrmDatabase xrdb; // xres - dpi
+ struct { // xres - dpi
+ int dpi; // xres - dpi
+ } xr; // xres - dpi
+
X_Output_Buffer *shbuf;
Soft16_Image *tmp_out; /* used by indirect render, like rotation */
Region clip_rects;
}
}
if (!e->engine.data.output) return 0;
+
+
+ {
+ int status;
+ char *type = NULL;
+ XrmValue val;
+
+ re->xr.dpi = 75000; // dpy * 1000
+ re->xrdb = XrmGetDatabase(re->disp);
+ status = XrmGetResource(re->xrdb, "Xft.dpi", "Xft.Dpi", &type, &val);
+ if ((status) && (type))
+ {
+ if (!strcmp(type, "String"))
+ {
+ const char *str, *dp;
+
+ str = val.addr;
+ dp = strchr(str, '.');
+ if (!dp) dp = strchr(str, ',');
+
+ if (dp)
+ {
+ int subdpi, len, i;
+ char *buf;
+
+ buf = alloca(dp - str + 1);
+ strncpy(buf, str, dp - str);
+ buf[dp - str] = 0;
+ len = strlen(dp + 1);
+ subdpi = atoi(dp + 1);
+
+ if (len < 3)
+ {
+ for (i = len; i < 3; i++) subdpi *= 10;
+ }
+ else if (len > 3)
+ {
+ for (i = len; i > 3; i--) subdpi /= 10;
+ }
+ re->xr.dpi = atoi(buf) * 1000;
+ }
+ else
+ re->xr.dpi = atoi(str) * 1000;
+ }
+ }
+ evas_common_font_dpi_set(re->xr.dpi / 1000);
+ }
+
/* add a draw context if we dont have one */
if (!e->engine.data.context)
e->engine.data.context =
Render_Engine *re;
re = (Render_Engine *)data;
+
+ if (re->xrdb) XrmDestroyDatabase(re->xrdb);
+
if (re->shbuf) evas_software_x11_x_output_buffer_free(re->shbuf, 0);
if (re->clip_rects) XDestroyRegion(re->clip_rects);
if (re->gc) XFreeGC(re->disp, re->gc);
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/extensions/XShm.h>
+#include <X11/Xresource.h> // xres - dpi
#include <sys/ipc.h>
#include <sys/shm.h>
#include "evas_common.h"
Tilebuf_Rect *rects;
Eina_Inlist *cur_rect;
int end : 1;
-
+
+#ifdef BUILD_ENGINE_SOFTWARE_XLIB
+ XrmDatabase xrdb; // xres - dpi
+ struct { // xres - dpi
+ int dpi; // xres - dpi
+ } xr; // xres - dpi
+#endif
+
void (*outbuf_free)(Outbuf *ob);
void (*outbuf_reconfigure)(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth);
int (*outbuf_get_rot)(Outbuf *ob);
evas_software_xlib_x_color_init();
evas_software_xlib_outbuf_init();
+ {
+ int status;
+ char *type = NULL;
+ XrmValue val;
+
+ re->xr.dpi = 75000; // dpy * 1000
+ re->xrdb = XrmGetDatabase(disp);
+ status = XrmGetResource(re->xrdb, "Xft.dpi", "Xft.Dpi", &type, &val);
+ if ((status) && (type))
+ {
+ if (!strcmp(type, "String"))
+ {
+ const char *str, *dp;
+
+ str = val.addr;
+ dp = strchr(str, '.');
+ if (!dp) dp = strchr(str, ',');
+
+ if (dp)
+ {
+ int subdpi, len, i;
+ char *buf;
+
+ buf = alloca(dp - str + 1);
+ strncpy(buf, str, dp - str);
+ buf[dp - str] = 0;
+ len = strlen(dp + 1);
+ subdpi = atoi(dp + 1);
+
+ if (len < 3)
+ {
+ for (i = len; i < 3; i++) subdpi *= 10;
+ }
+ else if (len > 3)
+ {
+ for (i = len; i > 3; i--) subdpi /= 10;
+ }
+ re->xr.dpi = atoi(buf) * 1000;
+ }
+ else
+ re->xr.dpi = atoi(str) * 1000;
+ }
+ }
+ evas_common_font_dpi_set(re->xr.dpi / 1000);
+ }
+
re->ob = evas_software_xlib_outbuf_setup_x(w,
h,
rot,
evas_software_xcb_x_color_init();
evas_software_xcb_outbuf_init();
+ // FIXME: re->xrdb
+
re->ob = evas_software_xcb_outbuf_setup_x(w,
h,
rot,
if (!data) return;
+#ifdef BUILD_ENGINE_SOFTWARE_XLIB
+ if (re->xrdb) XrmDestroyDatabase(re->xrdb);
+#endif
+
re = (Render_Engine *)data;
re->outbuf_free(re->ob);
evas_common_tilebuf_free(re->tb);
# include <X11/Xutil.h>
# include <X11/Xatom.h>
# include <X11/extensions/XShm.h>
+# include <X11/Xresource.h>
#endif
#ifdef BUILD_ENGINE_SOFTWARE_XCB
} x11;
unsigned char destination_alpha : 1;
+#ifdef BUILD_ENGINE_XRENDER_X11
+ XrmDatabase xrdb; // xres - dpi
+ struct { // xres - dpi
+ int dpi; // xres - dpi
+ } xr; // xres - dpi
+#endif
+
Ximage_Info *xinf;
Xrender_Surface *output;
Xrender_Surface *mask_output;
re->render_surface_line_draw = _xr_xlib_render_surface_line_draw;
re->render_surface_polygon_draw = _xr_xlib_render_surface_polygon_draw;
+ {
+ int status;
+ char *type = NULL;
+ XrmValue val;
+
+ re->xr.dpi = 75000; // dpy * 1000
+ re->xrdb = XrmGetDatabase((Display *)re->x11.connection);
+ status = XrmGetResource(re->xrdb, "Xft.dpi", "Xft.Dpi", &type, &val);
+ if ((status) && (type))
+ {
+ if (!strcmp(type, "String"))
+ {
+ const char *str, *dp;
+
+ str = val.addr;
+ dp = strchr(str, '.');
+ if (!dp) dp = strchr(str, ',');
+
+ if (dp)
+ {
+ int subdpi, len, i;
+ char *buf;
+
+ buf = alloca(dp - str + 1);
+ strncpy(buf, str, dp - str);
+ buf[dp - str] = 0;
+ len = strlen(dp + 1);
+ subdpi = atoi(dp + 1);
+
+ if (len < 3)
+ {
+ for (i = len; i < 3; i++) subdpi *= 10;
+ }
+ else if (len > 3)
+ {
+ for (i = len; i > 3; i--) subdpi /= 10;
+ }
+ re->xr.dpi = atoi(buf) * 1000;
+ }
+ else
+ re->xr.dpi = atoi(str) * 1000;
+ }
+ }
+ evas_common_font_dpi_set(re->xr.dpi / 1000);
+ }
+
return re;
}
Render_Engine *re;
re = (Render_Engine *)data;
+
+#ifdef BUILD_ENGINE_XRENDER_X11
+ if (re->xrdb) XrmDestroyDatabase(re->xrdb);
+#endif
+
evas_common_font_shutdown();
evas_common_image_shutdown();
while (re->updates)
#include <X11/Xatom.h>
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xrender.h>
+#include <X11/Xresource.h> // xres - dpi
#ifdef BUILD_ENGINE_XRENDER_XCB
# include <xcb/xcb.h>