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.

C Gauge Right Justify String...

Featured Replies

  • Commercial Member

It was forced on me, ironically enough, by almost the same problem you were facing. I needed to right-align an LED display for an INS system but mine was mono-spaced. I thought I'd found just the right font but unfortunately the figure 1 is completely misaligned. Back to searching.... :(-Dai

  • Author
  • Moderator
It was forced on me, ironically enough, by almost the same problem you were facing. I needed to right-align an LED display for an INS system but mine was mono-spaced. I thought I'd found just the right font but unfortunately the figure 1 is completely misaligned. Back to searching.... :(-Dai
Dai, I do believe this gentleman has a free font you can use, assuming you are looking for a 7-segment, mono-spaced, italic LED font:http://www.twyman.org.uk/Fonts/-or-http://www.mp3car.com/vbulletin/attachment...nt-lcd_font.zipThere are many variations on the 7-segment LED format (mistakenly called "LCD" in the zip filename). :)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Why not use a string class to manipulate strings then use c_str() to convert to a c-string?

// Borland C++ BuilderString s; // String to be paddedint p; // Length of padded stringchar cs[256]; // C-stringwhile (p > s.Length())	s = " " + s; strcpy(cs, s.c_str());

Gerry Howard

  • Author
  • Moderator
Be carefull!
Of what? The links I posted? I wouldn't post links to files I hadn't already confirmed were safe... :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
  • Moderator
Hi BillI recognise those URLs: Twyman is the one with the offset figure one and the other is based on a 14-segment display. :( If it wasn't for the figure one, Twyman would be perfect for this INS system.-Dai
Are you wanting the 1 to be the leftmost two segments or the rightmost two segments? The Twyman font and at least two of the others are the two rightmost segments, which is what I needed...I only needed the numbers though, so could care less about the letters and punctuation. :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Commercial Member

To get something reasonably realistic looking for the LED display I overlaid the orange (on) numbers over the top of some dark grey (off) figure eights (8). That's when I discovered that the figure one is offset from the right of the seven segment display. [Picture removed - see edit].I took another look at the LCD fonts you suggested but as I'd remembered, the centre crossbar is composed of two sections. -DaiEDIT: It's not Twyman - it's the way FS displays monospaced strings. I've tried three other LED/LCD-type fonts (commercial and freeware) and find that they all print the figure one offset from the right in the situation described above. So, two choices - solve the offset problem or dispose of the 'off' segments underneath. Guess which is the easiest and the least satisfying...

  • Author
  • Moderator

Oy veh! I see what you mean. Fortunately, my display doesn't need the "grey unlighted segments..."

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

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.