[Bug 1001033] Re: Monospaced font is not monospaced

Sam Bull fox_yrjkmk at trashmail.net
Sat Jun 2 19:43:14 UTC 2012


Unfortunately, that suggestion is no better. The rendered width of each
character varies, so the there is no single value that can place the
cursor in the correct place. If the character 'h' is 10 pixels and 'i'
is 9 pixels, then 'hih' will be 29 pixels and the cursor would need to
be placed at 0, 10, 19 and 29 pixels to make sense.

My solution for the labels, which works fine, is to find the rendered
length of the first character, then the length of the first two
characters, then the length of the first 3 characters and so on. Storing
all these values allows me to work out the correct position.

Because there's quite a bit of repetition, this can take a little bit of
CPU time. My only concern with the input box, is that it needs to
recalculate all of this, everytime the user types something, and it is
designed for use in games where a fraction of a millisecond can still be
important to keep the game running smoothly.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to freetype in Ubuntu.
https://bugs.launchpad.net/bugs/1001033

Title:
  Monospaced font is not monospaced

Status in “freetype” package in Ubuntu:
  Confirmed

Bug description:
  The "FreeMono" font in Ubuntu 12.04 seems to not be monospaced.

  More information can be read at: http://www.mail-archive.com/pygame-
  users at seul.org/msg16829.html

  A little further testing after this discussion, and I've noticed I
  don't have the problem with the "Ubuntu Mono" font, it just seems to
  be the "FreeMono" font which is causing the problem.

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: apport-gtk 2.0.1-0ubuntu7
  ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
  Uname: Linux 3.2.0-24-generic x86_64
  ApportLog:
   
  ApportVersion: 2.0.1-0ubuntu7
  Architecture: amd64
  CheckboxSubmission: d7186b4470c29fb9bde4930265e9b32c
  CheckboxSystem: 7e42599bda39ea7ff8b528272b6ef52b
  Date: Thu May 17 23:33:07 2012
  ExecutablePath: /usr/share/apport/apport-gtk
  InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
  InterpreterPath: /usr/bin/python2.7
  PackageArchitecture: all
  SourcePackage: apport
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/freetype/+bug/1001033/+subscriptions




More information about the foundations-bugs mailing list