Jump to content
Sign in to follow this  
wsieffert

Character spacing in an XML string ?

Recommended Posts

Hi,In an XML Text line, is there a directive to enlarge the spacing between the characters in a string ??So, with the same character font/size, a printed string becomes wider.Thanks, Rob

Share this post


Link to post
Share on other sites

Hello Rob, is Fixed=Yes what you are looking for?Just alter the Text x= value with it.

Share this post


Link to post
Share on other sites

Hi Ed,No, that's no it :-)In the .dtd I found a directive WidthFit="Yes" which suggests that the string width is adapted to the specified "X" width size of the printfield; which, with a given fontsize, could be done by increasing the inter-character spacing.Unfortunatly this directive doesn't appear to do anything :-(Thanks anyway,Rob

Share this post


Link to post
Share on other sites

Hi Rob,Never saw that code, only Width.May be ?/Did you try FormattedText?Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi Jan,As far as I know, the "Width" attribute comes from the "Area" tag, not the "Text" tag.Anyway, I found the tag "WidthFit" in the gauge.dtd file from the panel SDK.Rob

Share this post


Link to post
Share on other sites

Rob,Found it too.Never opened that one.Tested it also without results.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi Misho,THANKS !. That's a great tip indeed.Which makes me finally understand what the "Length" directive exactly does (in combination with the "Fixed" directive).After a little more experimentation with your tip, it appears to be working as follows:FS calculates the actual position of each character in the displayed string, by dividing the field width "X" by the "Length", and thus reserving a number of pixels for each character; independant of fontsize and string format specifier.Which means that if your format specifier specifies a string of a fixed width (like 7.2f ) same as "Length = (7), the string will fit exactly in the field width defined by "X". And doing this, the character spacing (in pixels) is then determined by "X" and the character fontsize. Note that the spacing can even become negative (= Characters overlap) depending on the chosen "X","Length", "Fontsize" and format specifier.Works great !!Cheers, Rob Barendregt

Share this post


Link to post
Share on other sites

Hi Rob,I believe this only applies to ? Because doesn't support "Lenght", and behaves rather different than CheersTom

Share this post


Link to post
Share on other sites

Hi Rob et al!Doug Horton asked me to look at the altimeter numbers on the A321 gauges because they were not visible in some cases. I was wondering if you could look at the XML and see if you can make an improvement.The altimeter tape also changes too quickly when one is climbing. I think it is the spacing of the numbers on the *.bmp file that causes this problem.I fixed the B737-800 MFD KTAS airspeed during Beta testing but the problem is still in the gauge. The programer wrote code that was universal but needed modified for true or indicated when used for a particular purpose. I don't have the XML in front of me but below shows basic coding:(A: Airspeed Select TRUE or Indicated)....should have been:(A: Airspeed True)..... for Trueor(A: Airspeed Indicted).... for indicated.The faulty line did in-fact present indicated even though the label indicates TAS.W. Sieffert

Share this post


Link to post
Share on other sites

Nearly 17 years later I found this thread and gave me a solution for character spacing, thank you guys!
As I love to see code snippets here is an example for this matter (thank you Rob Barendregt):
 <Element>
    <Visible>(A:CIRCUIT GENERAL PANEL ON, bool) (A:CIRCUIT AVIONICS ON, bool) &amp;&amp; (L:XPNDR_status, enum) 0 &gt; &amp;&amp;</Visible>
    <Position X="24" Y="29"/>
    <Text X="410" Y="25" Luminous="Yes" Length="4" Font="Arial Narrow" FontWeight="900" Color="#D7D7D7" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="Yes">
        <String>%((A:TRANSPONDER CODE:1, number))%!04d! </String>
    </Text>
 </Element>


The important parameters for spacing the 4 digit Transponder code equally alongside my four adjusting knobs are:
X="410"
Fixed="Yes"
Length="4"

Again, thank you all.
 

Edited by Flanker251

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...