瀏覽代碼

Add encoding= option

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32121 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 17 年之前
父節點
當前提交
c90b6ae747
共有 6 個文件被更改,包括 20 次插入4 次删除
  1. 2 0
      display/d.vect/attr.c
  2. 3 1
      display/d.vect/label.c
  3. 8 1
      display/d.vect/main.c
  4. 1 0
      display/d.vect/plot.h
  5. 3 1
      display/d.vect/topo.c
  6. 3 1
      display/d.vect/zcoor.c

+ 2 - 0
display/d.vect/attr.c

@@ -61,6 +61,8 @@ int attr ( struct Map_info *Map, int type, char *attrcol,
 	R_text_size(lattr->size, lattr->size) ;
 	if (lattr->font)
 	    R_font(lattr->font) ;
+	if (lattr->enc)
+	    R_charset(lattr->enc) ;
 		  
         if ( chcat ) {
 	     int found = 0;

+ 3 - 1
display/d.vect/label.c

@@ -39,7 +39,9 @@ int label (
 	R_text_size(lattr->size, lattr->size) ;
 	if (lattr->font)
 	    R_font(lattr->font) ;
-		  
+	if (lattr->enc)
+	    R_charset(lattr->enc) ;
+
         if ( chcat )
           {
 	     int found = 0;

+ 8 - 1
display/d.vect/main.c

@@ -101,7 +101,7 @@ main (int argc, char **argv)
 	struct Option *where_opt;
 	struct Option *field_opt, *cat_opt, *lfield_opt;
 	struct Option *lcolor_opt, *bgcolor_opt, *bcolor_opt;
-	struct Option *lsize_opt, *font_opt, *xref_opt, *yref_opt;
+	struct Option *lsize_opt, *font_opt, *enc_opt, *xref_opt, *yref_opt;
 	struct Option *attrcol_opt, *maxreg_opt, *minreg_opt;
 	struct Option *width_opt, *wcolumn_opt, *wscale_opt;
 	struct Option *render_opt;
@@ -283,6 +283,12 @@ main (int argc, char **argv)
 	font_opt->guisection = _("Labels");
 	font_opt->description= _("Font name");
 
+	enc_opt = G_define_option() ;
+	enc_opt->key        = "encoding" ;
+	enc_opt->type       = TYPE_STRING ;
+	enc_opt->guisection = _("Labels");
+	enc_opt->description= _("Text encoding");
+
 	xref_opt = G_define_option() ;
 	xref_opt->key        = "xref" ;
 	xref_opt->type       = TYPE_STRING ;
@@ -602,6 +608,7 @@ main (int argc, char **argv)
 
 	lattr.size = atoi(lsize_opt->answer);
 	lattr.font = font_opt->answer;
+	lattr.enc = enc_opt->answer;
 	switch ( xref_opt->answer[0] )
 	  {
 	    case 'l':

+ 1 - 0
display/d.vect/plot.h

@@ -14,6 +14,7 @@ typedef struct {
     struct rgb_color color, bgcolor, bcolor;
     int    size;
     char   *font;
+    char   *enc;
     int    xref, yref;
 } LATTR;
 

+ 3 - 1
display/d.vect/topo.c

@@ -21,7 +21,9 @@ int topo ( struct Map_info *Map, int type, int do_area, LATTR *lattr ) {
     R_text_size(lattr->size, lattr->size) ;
     if (lattr->font)
         R_font(lattr->font) ;
-	
+    if (lattr->enc)
+	R_charset(lattr->enc) ;
+
     Vect_rewind ( Map );
 
     num = Vect_get_num_lines(Map);

+ 3 - 1
display/d.vect/zcoor.c

@@ -22,7 +22,9 @@ int zcoor ( struct Map_info *Map, int type, LATTR *lattr ) {
     R_text_size(lattr->size, lattr->size) ;
     if (lattr->font)
         R_font(lattr->font) ;
-	
+    if (lattr->enc)
+	R_charset(lattr->enc) ;
+
     Vect_rewind ( Map );