Courier New Font problem ??

Just starting out? Need help? Post your questions and find answers here.
marc_256
Enthusiast
Enthusiast
Posts: 742
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Courier New Font problem ??

Post by marc_256 »

Hi,

my first test

Code: Select all

	If OpenWindow(0, 0, 0, 270, 160, "Loading font...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
		If LoadFont(1, "Courier New", 10)
			SetGadgetFont(#PB_Default, FontID(1))
			TextGadget(0, 10, 10, 250, 40, "Courier New 10")
		EndIf

		Repeat
		Until WaitWindowEvent() = #PB_Event_CloseWindow
	EndIf
result of the font test: all ok

Image

second test with CourierNew

Code: Select all

	EnableExplicit

	Global Event.i


If OpenWindow(0, 0, 0, 400, 200, "2DDrawing Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

	LoadFont(10, "Courier New", 12, #PB_Font_HighQuality)
	LoadFont(11, "Courier New", 10)		;, #PB_Font_HighQuality)
	LoadFont(12, "Courier New", 8, #PB_Font_HighQuality)

	LoadFont(13, "Courier New", 12, #PB_Font_Bold | #PB_Font_HighQuality)
	LoadFont(14, "Courier New", 10)		;, #PB_Font_Bold | #PB_Font_HighQuality)
	LoadFont(15, "Courier New", 8, #PB_Font_Bold | #PB_Font_HighQuality)


	If CreateImage(0, 400, 200, 32, $000000)
		StartDrawing(ImageOutput(0))

;- CLEAR BACK COLOR
			DrawingMode(#PB_2DDrawing_Default)
			Box(0, 0, 400, 200, RGB(100, 100, 100))		;255, 255, 255))

;- DRAW DEFAULT TEXT FONT
			DrawingFont(#PB_Default)
			DrawingMode(#PB_2DDrawing_Default)
			DrawText(10, 100, "TEST", $00E0E0E0, $00202020)

			DrawingMode(#PB_2DDrawing_Transparent)
			DrawText(10, 125, "TEST", $00E0E0E0, $00202020)

;- DRAW COURIER NEW TEXT FONT
			DrawingFont(11)
			DrawingMode(#PB_2DDrawing_Default)
			DrawText(100, 100, "TEST", $00E0E0E0, $00202020)

			DrawingMode(#PB_2DDrawing_Transparent)
			DrawText(100, 125, "TEST", $00E0E0E0, $00202020)

		StopDrawing()

		ImageGadget(0, 0, 0, 200, 200, ImageID(0))
	EndIf

	Repeat
		Event = WaitWindowEvent()
	Until Event = #PB_Event_CloseWindow

	EndIf
And the result here ??

Image

I see no CourierNew, what did I do wrong ??
I tested it all with #PB_Font_Bold and #PB_Font_HighQuality settings ...


PB 5.61 Final x64
WIN 8.1 x64

thanks,
marco
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4636
Joined: Sun Apr 12, 2009 6:27 am

Re: Courier New Font problem ??

Post by RASHAD »

Hi
Change:

Code: Select all

DrawingFont(11)
To :

Code: Select all

DrawingFont(FontID(11))
Egypt my love
marc_256
Enthusiast
Enthusiast
Posts: 742
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: Courier New Font problem ??

Post by marc_256 »

:oops: :oops: :oops: :oops: :oops: :oops:

thanks RASHAD,

Marco
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Post Reply