Foad S. Farimani
Foad S. Farimani

Reputation: 14008

How to modify text alignment in Pencil Project wireframes by editing embedded XML?

I'm using Pencil Project for creating wireframes of GUIs, and I want to learn how to modify the wireframe more accurately and precisely by editing the XML embedded within the .epgz files. Here's the scenario:

I placed a "Window Frame" from the "Desktop - Sketchy GUI" category into my canvas. The text in the title bar, which is "Window Title" by default, needs to be center-aligned. However, I couldn't find an option to control text alignment via the toolbar.

enter image description here

As a workaround, I opened the .epgz file (which is essentially a ZIP archive) using 7-Zip, and I edited the relevant page_*.xml file. Below is a snippet of the XML content where I attempted to modify the text alignment:

<foreignObject x="10" y="6" width="531" height="17" p:name="text" id="576925fb0dcf4c07a2e65b0e4ca5fa06" style="font-family: &quot;Comic Sans MS&quot;; font-size: 12px; font-weight: bold; font-style: normal; text-decoration: none; color: rgb(0, 0, 0); text-align: left;">
    <div xmlns="http://www.w3.org/1999/xhtml">Window Title</div>
</foreignObject>

I changed the text-align from left to center:

<foreignObject x="10" y="6" width="531" height="17" p:name="text" id="576925fb0dcf4c07a2e65b0e4ca5fa06" style="font-family: &quot;Comic Sans MS&quot;; font-size: 12px; font-weight: bold; font-style: normal; text-decoration: none; color: rgb(0, 0, 0); text-align: center;">
    <div xmlns="http://www.w3.org/1999/xhtml">Window Title</div>
</foreignObject>

After saving the XML and updating the archive, I reopened the file in Pencil, but the text was still left-aligned. I confirmed that the changes to the XML file were successfully saved, but Pencil doesn't reflect the updated alignment.

My question:

Relevant info:

Upvotes: 0

Views: 39

Answers (0)

Related Questions