[MPlayer-cvslog] r37078 - in trunk/gui/skin: font.c font.h

ib subversion at mplayerhq.hu
Thu Mar 27 00:17:55 CET 2014


Author: ib
Date: Thu Mar 27 00:17:54 2014
New Revision: 37078

Log:
Cosmetic: Rename fntChar members for width and height.

Modified:
   trunk/gui/skin/font.c
   trunk/gui/skin/font.h

Modified: trunk/gui/skin/font.c
==============================================================================
--- trunk/gui/skin/font.c	Wed Mar 26 20:23:38 2014	(r37077)
+++ trunk/gui/skin/font.c	Thu Mar 27 00:17:54 2014	(r37078)
@@ -71,8 +71,8 @@ static int fntAddNewFont(char *name)
     for (i = 0; i < ASCII_CHRS + EXTRA_CHRS; i++) {
         Fonts[id]->Fnt[i].x  = -1;
         Fonts[id]->Fnt[i].y  = -1;
-        Fonts[id]->Fnt[i].sx = -1;
-        Fonts[id]->Fnt[i].sy = -1;
+        Fonts[id]->Fnt[i].w = -1;
+        Fonts[id]->Fnt[i].h = -1;
     }
 
     return id;
@@ -167,12 +167,12 @@ int fntRead(char *path, char *fname)
             Fonts[id]->Fnt[i].y = atoi(buf);
 
             cutItem(param, buf, ',', 2);
-            Fonts[id]->Fnt[i].sx = atoi(buf);
+            Fonts[id]->Fnt[i].w = atoi(buf);
 
             cutItem(param, buf, ',', 3);
-            Fonts[id]->Fnt[i].sy = atoi(buf);
+            Fonts[id]->Fnt[i].h = atoi(buf);
 
-            mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[font]  char: '%s' params: %d,%d %dx%d\n", item, Fonts[id]->Fnt[i].x, Fonts[id]->Fnt[i].y, Fonts[id]->Fnt[i].sx, Fonts[id]->Fnt[i].sy);
+            mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[font]  char: '%s' params: %d,%d %dx%d\n", item, Fonts[id]->Fnt[i].x, Fonts[id]->Fnt[i].y, Fonts[id]->Fnt[i].w, Fonts[id]->Fnt[i].h);
         } else if (!strcmp(item, "image")) {
             av_strlcpy(buf, path, sizeof(buf));
             av_strlcat(buf, param, sizeof(buf));
@@ -285,11 +285,11 @@ int fntTextWidth(int id, char *str)
     while (*p) {
         c = fntGetCharIndex(id, &p, utf8, 1);
 
-        if (c == -1 || Fonts[id]->Fnt[c].sx == -1)
+        if (c == -1 || Fonts[id]->Fnt[c].w == -1)
             c = ' ';
 
-        if (Fonts[id]->Fnt[c].sx != -1)
-            size += Fonts[id]->Fnt[c].sx;
+        if (Fonts[id]->Fnt[c].w != -1)
+            size += Fonts[id]->Fnt[c].w;
     }
 
     return size;
@@ -315,10 +315,10 @@ static int fntTextHeight(int id, char *s
     while (*p) {
         c = fntGetCharIndex(id, &p, utf8, 1);
 
-        if (c == -1 || Fonts[id]->Fnt[c].sx == -1)
+        if (c == -1 || Fonts[id]->Fnt[c].w == -1)
             c = ' ';
 
-        h = Fonts[id]->Fnt[c].sy;
+        h = Fonts[id]->Fnt[c].h;
 
         if (h > max)
             max = h;
@@ -407,17 +407,17 @@ guiImage *fntTextRender(guiItem *item, i
         c = fntGetCharIndex(id, &u, utf8, 1);
 
         if (c != -1)
-            fw = Fonts[id]->Fnt[c].sx;
+            fw = Fonts[id]->Fnt[c].w;
 
         if (c == -1 || fw == -1) {
             c  = ' ';
-            fw = Fonts[id]->Fnt[c].sx;
+            fw = Fonts[id]->Fnt[c].w;
         }
 
         if (fw == -1)
             continue;
 
-        fh  = Fonts[id]->Fnt[c].sy;
+        fh  = Fonts[id]->Fnt[c].h;
         fyc = Fonts[id]->Fnt[c].y * fbw + Fonts[id]->Fnt[c].x;
         yc  = dx;
 
@@ -443,17 +443,17 @@ guiImage *fntTextRender(guiItem *item, i
             c = fntGetCharIndex(id, &u, utf8, -1);
 
             if (c != -1)
-                fw = Fonts[id]->Fnt[c].sx;
+                fw = Fonts[id]->Fnt[c].w;
 
             if (c == -1 || fw == -1) {
                 c  = ' ';
-                fw = Fonts[id]->Fnt[c].sx;
+                fw = Fonts[id]->Fnt[c].w;
             }
 
             if (fw == -1)
                 continue;
 
-            fh  = Fonts[id]->Fnt[c].sy;
+            fh  = Fonts[id]->Fnt[c].h;
             fyc = Fonts[id]->Fnt[c].y * fbw + Fonts[id]->Fnt[c].x;
 
             dx -= fw;

Modified: trunk/gui/skin/font.h
==============================================================================
--- trunk/gui/skin/font.h	Wed Mar 26 20:23:38 2014	(r37077)
+++ trunk/gui/skin/font.h	Thu Mar 27 00:17:54 2014	(r37078)
@@ -30,7 +30,7 @@
 
 typedef struct {
     int x, y;     // location
-    int sx, sy;   // size
+    int w, h;     // size
 } fntChar;
 
 typedef struct {


More information about the MPlayer-cvslog mailing list