> How can I load some specific fonts, like all Bengali Fonts...
>
[quoted text clipped - 7 lines]
>
> [Sorry for my poor English]
On Mar 18, 2:42 pm, "Mark Yudkin" <DoNotContac...@boingboing.org>
wrote:
> Without code, and system setup, it's impossible to do anything but a wild
> guess. First off, make sure you have Windows 2000, XP or Vista (you failed
[quoted text clipped - 5 lines]
> writing systems. The Indic font for Hindi is Devanagan, the arabic font you
> already have working according to your post.
Yep, I missed it... I'm using Windows XP SP2
I want to make a combo work like Microsoft Word's Complex Script Fonts
Combo (Press Ctrl+D in MS Word, If you've complex script installed in
your machine, then you can see this combo.... It works like, when you
type Hindi (In our country we use Hindi instead of Devanagari,
Devanagari is an ancient word but i had to mention it before. Sorry :
( ) this combo list contains only those fonts, who have Hindi
characters in their glyph... I think this time I make myself clear..
> Start -> Control Panel -> Regional and Language Options -> Languages. Make
> sure that both check boxes in Supplemental language support are checked.
[quoted text clipped - 4 lines]
> Validate the code page conversion tables, such as 57002 and 57003 for your
> case.
I
My Settings are ok...
> If all of this is OK, post your code.
Here is my font related coding...
..................
EnumFontFamiliesEx Me.hDC, LF, AddressOf EnumFontFamProc, ByVal 0&, 0
.............
Function EnumFontFamProc(lpNLF As LOGFONT, lpNTM As NEWTEXTMETRIC,
ByVal FontType As Long, lParam As Long) As Long
Dim FaceName As String
'convert the returned string to Unicode
FaceName = StrConv(lpNLF.lfFaceName, vbUnicode)
If (lpNLF.lfPitchAndFamily = 2 And lpNLF.lfCharSet = 0) Then Call
AddItemBySort(frmMain.comFont, Left$(FaceName, InStr(FaceName,
vbNullChar) - 1))
'continue enumeration
EnumFontFamProc = 1
End Function
.............
But in this way, one or two english font(s) also appear in my list..
AddItemBySort - It is a private function for adding item to a combo
using sort
> > How can I load some specific fonts, like all Bengali Fonts...
>
[quoted text clipped - 7 lines]
>
> > [Sorry for my poor English]
Thorsten Albers - 19 Mar 2007 12:06 GMT
Backslash <torifat@gmail.com> schrieb im Beitrag
<1174230234.645399.233570@y66g2000hsf.googlegroups.com>...
> EnumFontFamiliesEx Me.hDC, LF, AddressOf EnumFontFamProc, ByVal 0&, 0
You should show us how LF is initialized because this specifies what
EnumFontFamiliesEx() shall do.
> Function EnumFontFamProc(lpNLF As LOGFONT, lpNTM As NEWTEXTMETRIC,
> ByVal FontType As Long, lParam As Long) As Long
It doesn't matter for your code - but you should have in mind that
a) EnumFontFamiliesEx() wants a EnumFontFamiliesExProc() and not a
EnumFontFamiliesProc(), and
b) That the first parameter of both the EnumFontFamiliesExProc() and the
EnumFontFamiliesProc() isn't a pointer to a LOGFONT structure
(EnumFontFamiliesProc(): pointer to an ENUMLOGFONT structure;
EnumFontFamiliesExProc(): pointer to an ENUMLOGFONTEX structure).
This doesn't matter for your code since both the ENUMLOGFONT and the
ENUMLOGFONTEX structure start with a LOGFONT structure, so that a pointer
to an ENUMLOGFONT/ENUMLOGFONTEX structure is also a pointer to a LOGFONT
structure.
But for a good coding style you should use the appropriate callback
procedure which is for EnumFontFamiliesEx():
Function EnumFontFamExProc _
(
ByVal pELFE As ENUMLOGFONTEX, _
ByVal pNTME As NEWTEXTMETRICEX, _
ByVal lFontType As Long,
ByVal lParam As Long _
) As Long
End Funtion
> If (lpNLF.lfPitchAndFamily = 2 And lpNLF.lfCharSet = 0) Then Call
> AddItemBySort(frmMain.comFont, Left$(FaceName, InStr(FaceName,
> vbNullChar) - 1))
This selects only those fonts of the listed ones which have
- a variable pitch
- a font-family 'don't care'
- an ANSI character set
It is very unlikely that this indeed is the selection you want - unless the
LF initialization mentioned above is already used to get a restricted
enumeration.

Signature
----------------------------------------------------------------------
THORSTEN ALBERS Universität Freiburg
albers@
uni-freiburg.de
----------------------------------------------------------------------
Backslash - 19 Mar 2007 16:38 GMT
Thanks for your advice :) ....
I've tried with both EnumFontFamilies & EnumFontFamiliesEx and I've
two callback function in my coding... I had made the mistake when I'm
coping...
LF is nothing....
Dim LF As LOGFONT
EnumFontFamiliesEx Me.hDC, LF, AddressOf EnumFontFamProc, ByVal 0&, 0
Thorsten Albers - 19 Mar 2007 17:35 GMT
Backslash <torifat@gmail.com> schrieb im Beitrag
<1174318705.479417.192440@n59g2000hsh.googlegroups.com>...
> LF is nothing....
> Dim LF As LOGFONT
> EnumFontFamiliesEx Me.hDC, LF, AddressOf EnumFontFamProc, ByVal 0&, 0
In this case LF.lfCharset is 0 when passed to EnumFontFamiliesEx(). Since 0
is ANSI_CHARSET, only those fonts implementing the ANSI character set will
be enumerated - which possibly excludes the bengali and/or hindi fonts
which you want to be enumerated.

Signature
----------------------------------------------------------------------
THORSTEN ALBERS Universität Freiburg
albers@
uni-freiburg.de
----------------------------------------------------------------------
Thorsten Albers - 19 Mar 2007 19:04 GMT
Thorsten Albers <albersRE@MOVEuni-freiburg.de> schrieb im Beitrag
<01c76a44$36b1f0a0$a34bf8d9@thaldesk>...
> In this case LF.lfCharset is 0 when passed to EnumFontFamiliesEx(). Since 0
> is ANSI_CHARSET, only those fonts implementing the ANSI character set will
> be enumerated - which possibly excludes the bengali and/or hindi fonts
> which you want to be enumerated.
I forgot: Set LF.lfCharset to DEFAULT_CHARSET (= 1) to enumerate all fonts.
Then select the fonts wanted either by the codepage bit or the Unicode
coderange bit in NEWTEXTMETRICEX.FONTSIGNATURE.fsCsb/.fsUsb.

Signature
----------------------------------------------------------------------
THORSTEN ALBERS Universität Freiburg
albers@
uni-freiburg.de
----------------------------------------------------------------------
Backslash - 20 Mar 2007 14:35 GMT
Thanks bro, I'll try it and inform you later :D, thanks again