Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Character spacing in an XML string ?

Featured Replies

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

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

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

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

Jan

 

 

 

"Beatus ille qui procul negotiis..."

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

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

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • 1 month later...
  • Commercial Member

This does the trick for me:In the line:

P3D SpacePort Team

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

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

Hi Tom,Don't know ..I have never used FormattedText :-)So you might be right..Cheers, Rob

  • Author

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

Bill Sieffert

  • 16 years later...

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

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.