Re: newbie question - how to enumerate font
- From: "Francesco Ranieri" <francesco.ranieri@xxxxxx>
- Date: Mon, 17 Dec 2007 18:14:01 +0100
Thanks again Mark
A good dictionary can deceive an US teacher?!! :)
Excuse me... I've become blind: the link you have mentioned last post was
manifest but I've fixed my glassy stare on "EnumFontFamilies" and I've not
seen the rest of the text!!
I think next Christmas will be spent on studying P/Invoke and Chinese!! ;)
Processor has ARM-architecture (ARM926T-AT4X0A)!
The simpliest operation I've made is generating FontPicker (compatible with
VS2003) and installing it to device. Executing the exe, as if by magic it
appeared before me: the solution!!!
Next step is to implement the solution in my application... I think this
will not so hard.
Thanks Mark... you have saved my head!!
Francesco
"Mark Erikson" <mark.erikson@xxxxxxxxx> ha scritto nel messaggio
news:1ac18944-a1e3-4070-b3c9-82be14d30cbf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Dec 17, 9:19 pm, "Francesco Ranieri" <francesco.rani...@xxxxxx>the
wrote:
Thanks Mark,
Thank you very much for spending your time for us!!!
Google has given to me several responses to my question but, the "must",
always was "CF2.0", as also your requirement!
As further trouble, I've started programming vb.net for 1 month.... I'm
yourreally newbie.
I've to tell you however, no response I've found is very satisfying as
updateand no-one has taken the trouble to do a useful sample.
I'm programming my Navigation System... not a PocketPC... so, I can't
2003]+[CF1.0]+[WinCE5.0].CF 1.0 to v. 2.0.
I can't even update operative system... both are into Flash memory and I
wouldn't touch ti for keeping product warranty...
All I can do is... programming reasonably [VB.net
newer
What I need is something would run with first version of CF.
I've downloaded your project: my .net 2003 says "project created with
haven'tversion of Visual Studio".
Ok... I've opened each file instead the project... code is C#... I
andfound VB code.
I've searched for vb code... no source found!!!
But I'm afraid that, even though I succeed to "understand" your C# code
more!manage it into mine, I will be not able to install it into my navigation
system cause CF incompatibily.
I've searching for fontlist.dll... as you foreseen, it is available no
able to
Looking at Fonts Functions into MSDN
(http://msdn2.microsoft.com/en-us/library/ms901099.aspx), I'm not be
before...find the way to use Windows CE native functions... as I've said
I'm not skilled about this argument.
Any idea to "outflanking" CF2.0?
Thanks again!!!
P.S.: I hope my bad english has made myself clear!!!
Don't worry about your English. I've been teaching English outside
the US for the last couple years, and trust me - you're doing just
fine :)
As for this project - first off, I suggest you learn about about
something called "P/Invoke". That 's the system that .NET uses to
communicate with "unmanaged" (C / C++ / etc) code, especially DLLs.
Basically, you tell .NET the name and information of the DLL function
you're interested in, and then you can use it from C# or VB.NET.
Here's a couple of useful pages explaining it in more detail:
http://msdn2.microsoft.com/en-us/library/aa288468.aspx
http://www.beansoftware.com/NET-Tutorials/Unmanaged-Code-PInvoke.aspx
Second, there are a couple utilities out there which will convert
VS2005 projects backwards into VS2003 projects:
http://www.codeproject.com/KB/cs/WhidbeyProjectConverter.aspx
http://www.csksoft.net/blog/post/UnPrjConvertor.html (note: appears
to be written in Chinese, and may only work for C++ projects)
Anyway, in order to list fonts, we really need to use that
EnumFontFamilies function. The problem is that EnumFontFamilies
requires that you give it a "callback" function. Every time
EnumFontFamilies finds something interesting (like the name of a
font), it passes that to your callback. It's relatively easy to
create a callback in C++, but harder in .NET. More importantly, CF
2.0 has the ability to make one, but CF 1.0 doesn't.
Because of this, the only way to do this from CF 1.0 is to create a
DLL of your own that creates a callback, calls EnumFontFamilies, and
then passes that information back up to your .NET program. Happily,
the authors of "Programming the .NET Compact Framework in C#/VB.Net"
already did this for us - the "fontlist.dll" that your sample is
looking for, which is included in the sample code for their book. Go
to http://www.isquaredsoftware.com/code.php and download the link
marked "VB.NET sample code", down at the bottom. That links to a file
named YaoDurantCFSource1.0-VB.zip, which is the sample source from
their book.
If you extract that somewhere, there's two things inside that are
useful here. First, look for YaoDurant\CPP\Ch16_TextAndFonts\FontList
\FontList.cpp. That's the C++ source code for fontlist.dll. Second,
look in YaoDurant\VB\Ch16_TextAndFonts\FontPicker. They've got a VB
sample project that not only demonstrates how to use fontlist.dll, but
also actually does much of what you're asking. If you look in
YaoDurant.Drawing.FontCollection.vb, you'll see how they use the DLL
and its functions from VB.NET. Also, the project files should be
compatible with VS 2003.
Finally, do you know what kind of processor your navigation system is
using? If it's ARM, then you can use the fontlist.dll that's included
in the project. If it's something else, you may need to recompile the
DLL yourself so that it can run on your system.
Let me know how things go from there.
Mark Erikson
http://www.isquaredsoftware.com
.
- Follow-Ups:
- Re: newbie question - how to enumerate font
- From: Mark Erikson
- Re: newbie question - how to enumerate font
- References:
- newbie question - how to enumerate font
- From: Francesco Ranieri
- Re: newbie question - how to enumerate font
- From: Francesco Ranieri
- Re: newbie question - how to enumerate font
- From: Mark Erikson
- Re: newbie question - how to enumerate font
- From: Francesco Ranieri
- Re: newbie question - how to enumerate font
- From: Mark Erikson
- newbie question - how to enumerate font
- Prev by Date: Re: SerialPort Caching?
- Next by Date: Re: SerialPort Caching?
- Previous by thread: Re: newbie question - how to enumerate font
- Next by thread: Re: newbie question - how to enumerate font
- Index(es):
Relevant Pages
|