Languages

Menu
Sites
Language
Text upside down

Hi, i want to show the text on some labels upside down, looking at the documentation i didn't found a solution. 

And is possible to do the same for objects like button, spinners?

View Selected Answer

Responses

13 Replies
Yasin Ali

Hi,

You may use font support like http://www.upsidedowntext.com/

Copy upside down  font to your code.

Hope it will help you.
If you find my post is helpful for you, please mark it as answer to promote this post to others.

Ivan Gualandri

Hi, the problem is that the text will be changed dynamically, so i can't just copy and paste upsidedown text. 

So my idea is to have the label rotated of 180 degrees. 

Is that possible?

I found this example https://developer.tizen.org/development/guides/native-application/user-interface/efl/transformation-evas-map 

But maybe the 

evas_map_util_rotate 

is to add a rotation animation.

What i want is that the label is rotated since the beginning. Is that possible??

If i can use evas_map_util_rotate for my case, how i get access to the label object? (i know that it is possoble from an event handler), but it is possible doing it during ui creation? 

 

Yasin Ali

You may try with

evas_map_util_rotate(map, angle, cx, cy): This performs a rotation of the angle degrees around the center point with the coordinates (cx, cy).

Link: https://developer.tizen.org/dev-guide/2.4/org.tizen.ui.practices/html/native/efl/evas_objects_n.htm

and also with check  https://developer.tizen.org/community/code-snippet/native-code-snippet/rotating-parts-edc-file

for "Rotating parts in EDC file"

Check these for your current requirements. Hope they will meet your requirements.

 

Ivan Gualandri

HI, i

i'm trying to do it using edc component. 

I ended up with the following code:

EDC File: 

collections 
{
   group 
   { 
      name: "upside_down";
      parts 
      {
         text { "label2";
            scale: 1;
            desc { "default";
               color: 255 255 255 255;
               color2: 255 255 255 255;
               visible: 1;
               text {
                  size: 50;
                  font: "Sans";
                  text: "TEXT";
                  align: 0.5 0.5;
                  min: 0 0;
               }
               align: 0.5 0.5;
               rel1.relative: 0.25 0.25;
               rel2.relative: 0.75 0.75;
               map 
               {
                  on: 1;
                  rotation.z: 180;
                  perspective_on: 1;
                  backface_cull: 1;
               }
            }
         }
      }
   }
}

And the code to load the layout: 

    char edj_path[PATH_MAX] = {0, };
	// Get the full path of the edj file
	app_get_resource("./res/edje/label.edj", edj_path, (int)PATH_MAX);

	// Load check custom style as an extension
	elm_theme_extension_add(NULL, edj_path);
	if(elm_object_style_set(vc->label2, "upside_down") == EINA_FALSE){
		dlog_print(DLOG_INFO, "MyTag", "Problems");
	} else {
		dlog_print(DLOG_INFO, "MyTag", "FINE");
	}

 

I don't get any error.

I create a label called label2.

But when i try to launch the application, the label isn't rotated. Why?

Probably i i'm doing something wron?

Yasin Ali

I think you need to use rotation.x. Hope it'll work.

Ivan Gualandri

No, probably something is wrong with my code. Anyway the labele isn't rotate same position using x,y,z, as if the style is not applied. 

I'm trying to apply this style during the view_create event, I'm not sure if it is 

possible during that event. 

Any other idea?  

I created the following gists, that contains all the code, with all the tests i made (look at the commented parts also): https://gist.github.com/inuyasha82/e169ada457b2b5d1194d435e5b45244a

Thanks

 

 

Ivan Gualandri

Ah, i don't know if it change something, but i forgot to mention that i'm creating the ui using the UiBuilder. 

Ivan Gualandri

Ah, i don't know if it change something, but i forgot to mention that i'm creating the ui using the UiBuilder. 

Mark as answer
Yasin Ali

Hi,

I tried with code like below and in my case it works fine:

collections 
{
   group 
   { 
      name: "sample";
      parts 
      {
         text { "label2";
            scale: 1;
            desc { "default";
               color: 0 0 255 254;
               color2: 255 0 0 255;
               visible: 1;
               text {
                  size: 50;
                  font: "Sans";
                  text: "TEXT";
                  align: 0.5 0.5;
                  min: 0 0;
               }
               align: 0.5 0.5;
               rel1.relative: 0.25 0.25;
               rel2.relative: 0.75 0.75;
               map 
               {
                  on: 1;
                  rotation.z: 180;
                  perspective_on: 1;
                  backface_cull: 1;
               }
            }
         }  
      }
   }
}

Hope it will help.

 

Ivan Gualandri

Yeah! It helped! Thanks. 

The only thing i don't understand is why i had to change the name of the style from "sample" to: "elm/label/default/custom". Otherwise with only sample as name, it was not working (it wasn't applying the style at all! 

Thanks a million!!

Ivan Gualandri

Ok, now i'm facing another problem.

I want this label to be updated dynamically, but if i set the text, it will always display the word in the edc file, no matter what i set.

And if i remove the text attribute, it is always empty.

What can i do to update this label programmatically keeping the rotated style? 

Yasin Ali
Ivan Gualandri I think it is better to discuss with your another problem within a new thread.
It will be better for other user. Post a new thread with your problem details.
Thanks.

             

Ivan Gualandri

@Yasin i created the new topic, this is the link: https://developer.tizen.org/forums/native-application-development/cannot-change-text-styled-edc-label 

thanks for your help.