Marlett Font: Can I load it and use it in WinAPI - c++

What functions do I use to load the Marlett font in Native WinAPI(if its possible)?
I am attempting to create my own transparent checkbox in Native WinAPI. I am at the stage where I need to draw the checkbox tick therefore it would be cool if I could just load the Marlett font then TextOut() - ie print - the checkbox tick.
Maybe I need to obtain a copy of the Marlett font as a file then I load it in at runtime, or is it on all Windows OS's from 2k upwards?
http://www.siao2.com/2006/01/26/517738.aspx

This is answered trivially by consulting Wikipedia:
Marlett is a TrueType font that has been used in Microsoft Windows since Windows 95.
Hence you can just load the font using the conventional CreateFont or CreateFontIndirect, if you prefer.

Related

MFC Picture Control is not scaled automatically according to Windows display scale

I have a Picture Control in my application which is not scaled properly according to the Windows zoom - 100, 125, 150 % etc.
I have done a research but only found a solution for C#, which is handled by a property AutoScaleMode = AutoScaleMode.Dpi;
Can anyone tell me what is the alternative in MFC?
MFC applications automatically default themselves to be DPI aware, this means that it assumes any resizing for bitmaps etc will be handled by the app (e.g. the app may have multiple versions of the same bitmap depending on DPI settings). It makes the app look much neater on scaled machines because the alternative is to automatically scale the whole app which can make it look 'fuzzy'.
You can switch OFF DPI awareness, have a look at this article:
MFC applications now default to being DPI-aware

Set console font size in fullscreen mode

I use SetConsoleDisplayMode() to switch the console into fullscreen mode. It is 80x25, centered in the middle with quite a small font, which I'd like to enlarge.
I still work on WinXP, so SetCurrentConsoleFontEx() is not an option for me. I found this link which describes some undocumented functions including SetConsoleFont(). They work great: the GetNumberOfConsoleFonts() returns 9 usable fonts on my system and I can pick some, however under fullscreen 0 font were found, which means it is not supported.
I also tried to create shortcut to the program and set the console there, but there's no fullscreen option and after switching to fullscreen all font settings are discarded.
I'd like to convince the screen to show nice big text font, just like in sci-fi movies or in good old BIOS assembly coding. Is it possible under XP?
The full-screen console mode switches the display adapter into 80x25 VGA text mode.
Thus font-rendering is completely different. In a normal console window the font is rendered using GDI; in full-screen mode Windows writes a character code to the display buffer and the hardware renders the font.
VGA supports loadable fonts and Windows uses this feature to support its different language versions. I don't remember if the font is fixed by the language version of Windows or if its chosen to match the current code page. (Full-screen mode doesn't work on x64 and I don't have a 32-bit system handy to try it.)
I'm not aware of you getting any kind of choice in the VGA font used, though there's probably some mileage in overwriting the VGA fonts in the Fonts directory. Though obviously this isn't something you'd want to be doing in production.
Finally, it might be possible to change the font using an actual DOS app! I know Windows NT traps some video-related IOs and passes them through to the hardware. This isn't much use though.
Did you try to write out GetLastError()? My opinion is that this will not be working on windows 7 or later.
Maybe you could try this: #define _WIN32_WINNT 0x0601
Cheers!

X11 graphics programming Font

I am developing User Interface software using X11 programming.(I am not used QT, Widget, GTk).In that i want to increase font size using font property function. How can i use XFontProp function? Is there any other method to increase font size using X windows? If is it possible give me a sample?
If you want to use the old-fashioned now-deprecated server-side font rendering method, you cannot change the font size, you need to load the correctly-sized fond. Use XLoadFont and/or XLoadQueryFont for this. Use the Font you get in your GC.
To see what the string parameter looks like, type xlsfonts on your computer, or use xfontsel GUI utility.
Note that any given X server may lack fonts you want to use. There are only few mandatory fonts including fixed and I forgot what else.
If you want to use the fashionable modern client-side font rendering (what most programss written today are using) you have to use one of the toolkits, or Xft2 or Cairo libraries.

SDL changing cursor to Windows default

I'm making a simple windowed game and I want a standard system cursor instead of SDL's black one. Is this possible without manual creation of cursor?
This is not possible as far as I know. Because SDL works on all major platforms, even those without default cursors, SDL creators decided to always use a custom cursor. Drawing the default system cursor shouldn't be that hard though - just load the .cur file and paint it as a bitmap.
It is possible for you to to display 4 types of default SDL cursors with the help of SDL_CreateCursor. The SDL documentation provides this information:
http://www.libsdl.org/cgi/docwiki.cgi/SDL_CreateCursor

Simple way to set font type in MFC CListBox

I have always used the default ListBox control with the property of OWNER DRAW set to NO. But now I need to set a fixed sized mono font since my formatted strings are not aligning up even though I have the default right aligned and necessary width padding set beyond the actual size of the digit string.
My problem is I don't have a clue the simplest way to code for this nor have I ever coded for OWNER DRAW set to anything other than NO.
Appreciate any input or examples or links.
Additionally would like information on how would I check to even see what fixed mono width fonts are available on the system running my app?
(C++ MFC, Visual Studio)
Declare a CFont object and init it with CFont::CreateFont.
"Courier New" is usually a good choice for fixed width fonts.
Use CListBox's SetFont() method (inherited from CWnd) to replace the default one.
Don't know about CListBox, but in the standard Windows listbox, you can use the WM_SETFONT message to set the font of the control. CListBox probably wraps the native listbox, so if you can get the HWND of the CListBox, it should be easy to set the font of it using WM_SETFONT.