Inline Image and Text in EDC with Proper Alignment

Original Created Feb 16, 2017 | Regeneration Apr 22, 2026

I created an EDC file containing an inline image and text. However, when the text is longer, it expands in both directions. I tried making it expand only to the right but was unsuccessful.

I also attempted to create a horizontal box with an image, but the image wasn't working as expected.

What I want to achieve: [Img] short text [Img] little longer text

What I currently have: [Img] short text [Img] little longer text

Here's my EDC file:

collections
{
   base_scale: 1.0;
   group 
   {
      name: "horizontal_image_text";
      parts 
      {
         part 
         {
            name: "image";
            type: SWALLOW;
            description 
            {
               state: "default";
               fixed: 1 1;
               align: 0.0 0.0;
            }
         }
         part
         { 
            name: "text";
            type: TEXT;
            description 
            { 
               state: "default";
               fixed: 1 1;
               rel1.to: "image";
               rel2.to: "image";
               rel1.relative: 1.0 0.5;
               rel2.relative: 4.0 0.5;
               text 
               {
                  font: "Tizen:style=Regular";
                  size: 35;
                  min : 1 1;
               }
               color: 255 255 255 255;
            }
         }        
      }
   }
}

Problem Understanding

The user wants to create an EDC layout with an image and text where:

  1. The text should align properly next to the image
  2. Text expansion should only occur to the right
  3. The image should maintain its position regardless of text length

Solution Methods

  1. Using the align property:

    • Add an align property to the text part to control text positioning
    • Example: align: 0.25 0.0; for left alignment with offset
  2. Proper relative positioning:

    • Adjust rel1.relative and rel2.relative values to control text positioning relative to the image
    • Ensure proper spacing between image and text
  3. Complete layout example:

    • Use a combination of image and text parts with proper relative positioning and alignment

Code Examples

Here's a working example that maintains image aspect ratio and properly aligns text:

collections { group { name: "x";
  images.image: "x.jpg" LOSSY 80;
  parts {
    part { name: "image"; type: IMAGE;
      description { state: "default" 0.0;
        image.normal: "x.jpg";
        aspect: 1.0 1.0;
        aspect_preference: VERTICAL;
        min: 32 32;
        align: 0.0 0.5;
        rel2.relative: 0.0 1.0;
      }
    }
    part { name: "text"; type: TEXT;
      description { state: "default" 0.0;
        color: 255 128 0 255;
        rel1.to: "image";
        rel1.relative: 1.0 0.0;
        rel1.offset: 40 0;
        text { font: "Sans"; size: 35;
          text: "Hello world";
          align: 0.0 0.5;
          min: 1 1;
        }
      }
    }
  }
} }

Additional Tips

  1. For SWALLOW type images, remove the image.normal line
  2. Adjust the rel1.offset value to change the spacing between image and text
  3. Use aspect_preference: VERTICAL to maintain image aspect ratio
  4. Experiment with different alignment values to achieve the desired layout

Customize your cookie preferences

You can enable or disable non-essential cookies. Essential cookies are always on to ensure the site works properly and to keep you signed in.

Necessary

These cookies are necessary for the website to function properly and cannot be switched off. They help with things like logging in and setting your privacy preferences.

Always on

Analytics

These cookies help us improve the site by tracking which pages are most popular and how visitors move around the site.

Enable analytics cookies
Public Forum Public Forum
Employees only. Please sign in with your company account.