[quoted text, click to view] > Just like you i also was looking for precise string length (as precise as
> possible anyway) and for now the result is acceptable to me.
> It still does have its approximation problems, but it is atleast supposed
> to be more accurate than MeasureString. Hopefully you will be able to work
> something out using trial and error and some relatively consistent
> adjustment factors.
>
> Measuring string length, is considered to be a tricky one, and atleast
> when i last researched it, could not get to a 100% accurate mechanism used
> by anyone.
>
> I'd be very interested in the final implementation you come up with, even
> if it is for academic reasons :)
>
I read in the .NET 2.0 documentation that, for accurate font metrics, use
GDI. GDI+, it profusely cautions, is not as accurate as GDI+. What is the
purpose of GDI+ if it is so crippled (many other examples) compared to GDI,
further more, it doesn't appear to be regularily enhanced and less capable
(can't use bitmap fonts, for example).
In any case, this isn't academic, in the general sense. I'm creating a
console replacement that has more features than the standard console, such
as a text-mode GUI (ala TurboVision), more than 16 colors (So far I have a
color pallette of 256 colors (customizable), 16 being reserved to match the
same 16 of the system console, transparency (alpha-blending), bitmaps, and
so on. One might actually argue with me whether its even necessary. I'll
agree, its certainly not modern, but I have a fascination with console
applications and I'm wanting to experiment on a smaller scale some concepts
that are otherwise hidden from me by using someone elses (win32) API.
Besides, the drawing techniques are very similar in nature to a music
editing package I'm working on, and I'm experimenting with different
techniques.
In any case, I'm in the process of creating some massive network and
communications libraries and protocols, and I'm thinking about using the
console as the interface, and would rather it not be command-based, but
would like to experiment with making text-mode GUI's for this. I've already
created a console class that uses the system console API's to do the same,
except it is limited in colors to the standard 16 that the console API
supports, without transparancies, and no support for bitmaps and other
feature I'm putting into it that the console API doesn't directly support,
nor can I find an easy way to implement it. sush as drag-and-drop (with
itself and with windows) and so on. It is indeed an interesting excercise.
Also, I'm creating a tablature editing package for guitarists and was
thinking about creating some of my internal tools using the text-mode GUI
(others will probly never see the utilities). Just another way for me to
excercise my nuerons, is all.
I'm in the process of creating a TrueType font for the DOSAPP.FON fonts used
by the system console, since I don't like using "Lucida Console" very much
and I'm having a heck of a time locating one or a tool to convert them, all
the tools I found simply don't do good enough job, a joke at best.
I am creating the means to pipe in and out of the console (using named and
anonymous pipes) so it'll be pretty close to the original.
One of the major things, is that each character position on the screen needs
to be treated like a character position, not a string, to make this thing
work right. The mouse, as with the System Console, is accurate only to the
character, although, I must provide a way to make it accurate to the pixel
as well, but for text purposes, I must be able to predict the characture in
the grid.
Thanks,
Shawn
http://www.zenofdotnet.com