• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with character behavior (lowercase ,uppercase)

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I show 2 strings to client say s1 and s2 like
s1 s2.
s1 can be maximum length 15 .I add some spaces to s1 and make it string of size 20 .For e.g. if i has s1="Ahmed" then i add 15 spaces to the left and if it contain "OWMHJU" then i add 14 spaces to the left .In this way it look like
s1 s2
s1 s2 and not like
s1 s2
s1 s2
s1 and s2 can contian lowercase and uppercase characters and i not have the option of coverting it to lowercase or uppercase.I has to preserve the case.The problem is for the same number of characters lowercase and uppercase characters occupy different space because of this the look slightly distorted.Is there is any method so that lowercase and uppercase characters same space.
Thanks
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fonts which behave the way you describe are called proportional fonts. Times, Helvetica, Arial, etc., are all proportional fonts. But there are also fonts where every character is the same width: these are called fixed-pitch or monospace fonts. Courier, Monaco, and Andale Mono are common examples of a fixed-pitch font.

So in any event: set the font of your GUI component to be a fixed-pitch font, and that will fix your problem.
 
reply
    Bookmark Topic Watch Topic
  • New Topic