Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
Autor |
Nachricht |
arduno
Anmeldungsdatum: 12.05.2011 Beiträge: 252
|
Verfasst am: 17.10.2014, 15:31 Titel: Den Text in Screenres grösser darstellen. |
|
|
Hallo, guten Tag.
Ich habe leseprobleme mit dem Text im Screenres-Fenster.
Wie kann man den Text bitte dort grösser darstellen?
Oder wie kann man eine Textconsole öffnen ?
Danke.
Gruss |
|
Nach oben |
|
|
nemored
Anmeldungsdatum: 22.02.2007 Beiträge: 4609 Wohnort: ~/
|
Verfasst am: 17.10.2014, 16:00 Titel: |
|
|
Es gibt drei vorgegebene Zeichensätze: 8x8 (Standard), 8x14 und 8x16. Umstellen kannst du mit WIDTH.
Wenn du andere Schriftarten/-größen willst, kannst du bei DRAW STRING einen eigenen (FreeBASIC-Grafikpuffer-)Font verwenden; dazu hat Volta ein gutes Tutorial geschrieben. _________________ Deine Chance beträgt 1:1000. Also musst du folgendes tun: Vergiss die 1000 und konzentriere dich auf die 1. |
|
Nach oben |
|
|
arduno
Anmeldungsdatum: 12.05.2011 Beiträge: 252
|
Verfasst am: 17.10.2014, 16:47 Titel: |
|
|
Jup, danke.
habe jetzt dazu bitte Fragen.
Was wird damit bitte eingestellt:
CONST FF_LUCIDA = 54
CONST FF_TERMINAL = 48
Was bedeuten diese Werte:
SetConsoleFont("Lucida Console", 10, 16, ..
Danke.
Gruss
Code: |
#INCLUDE ONCE "windows.bi"
'ab Windows Vista
CONST FF_LUCIDA = 54
CONST FF_TERMINAL = 48
TYPE CONSOLE_FONT_INFOEX
cbSize AS UINTEGER
nFont AS INTEGER
dwFontSize AS COORD
FontFamily AS UINTEGER
FontWeight AS UINTEGER
FaceName AS WSTRING * LF_FACESIZE
END TYPE
DECLARE FUNCTION SetConsoleFont(BYVAL sTypeface AS STRING, wFontWidth AS SHORT, wFontHeight AS SHORT, wFontStyle AS SHORT) AS INTEGER
DIM SHARED AS ANY PTR Kernel32
DIM SHARED GetCurrentConsoleFontEx AS FUNCTION (BYVAL hConsoleOutput AS HANDLE _
, BYVAL bMaximumWindow AS INTEGER _
, BYVAL lpConsoleCurrentFontEx AS ANY PTR) AS INTEGER
DIM SHARED SetCurrentConsoleFontEx AS FUNCTION (BYVAL hConsoleOutput AS HANDLE _
, BYVAL bMaximumWindow AS INTEGER _
, lpConsoleCurrentFontEx AS ANY PTR) AS INTEGER
Kernel32 = DYLIBLOAD( "Kernel32.dll" )
IF Kernel32 THEN
GetCurrentConsoleFontEx = DYLIBSYMBOL( Kernel32, "GetCurrentConsoleFontEx" )
SetCurrentConsoleFontEx = DYLIBSYMBOL( Kernel32, "SetCurrentConsoleFontEx" )
ELSE
END
ENDIF
DIM AS INTEGER dwMxScrn = SetConsoleFont("Lucida Console", 10, 16, FF_LUCIDA)
IF dwMxScrn THEN
PRINT "Konsole mit " & LOWORD(dwMxScrn) & "x" & HIWORD(dwMxScrn) & " Zeichen."
END IF
DYLIBFREE Kernel32
SLEEP
FUNCTION SetConsoleFont(BYVAL sTypeface AS STRING,wFontWidth AS SHORT _
, wFontHeight AS SHORT, wFontStyle AS SHORT) AS INTEGER
DIM hConHdl AS HANDLE = GetStdHandle(STD_OUTPUT_HANDLE)
IF hConHdl < 0 THEN RETURN 0
DIM ConFont AS CONSOLE_FONT_INFOEX
WITH ConFont
.cbSize = SIZEOF(ConFont)
.nFont = 0
.FontFamily = wFontStyle
.dwFontSize.X = wFontWidth
.dwFontSize.Y = wFontHeight
.FaceName = sTypeface
END WITH
IF SetCurrentConsoleFontEx(hConHdl, 1, @ConFont) THEN
GetCurrentConsoleFontEx(hConHdl, 1, @ConFont)
FUNCTION = ConFont.dwFontSize.X SHL(16) + ConFont.dwFontSize.Y
END IF
END FUNCTION
|
|
|
Nach oben |
|
|
grindstone
Anmeldungsdatum: 03.10.2010 Beiträge: 1220 Wohnort: Ruhrpott
|
Verfasst am: 18.10.2014, 06:41 Titel: |
|
|
Hallo arduno!
Die Kopfzeile von SetConsoleFont hat doch wunderbar "sprechende" Variablennamen:
wFontWidth = Buchstabenbreite
wFontHeight = Buchstabenhöhe
wFontStyle = Buchstabenstil wobei das "w" an Anfang für "word" ( = 2 Bytes) steht.
Gruß
grindstone _________________ For ein halbes Jahr wuste ich nich mahl wie man Proggramira schreibt. Jetzt bin ich einen! |
|
Nach oben |
|
|
arduno
Anmeldungsdatum: 12.05.2011 Beiträge: 252
|
Verfasst am: 18.10.2014, 11:27 Titel: |
|
|
Jup, danke.
Nur wenn ich ARIAL lade, funktionieren die nicht.
wFontWidth = Buchstabenbreite
wFontHeight = Buchstabenhöhe
Danke.
Gruss |
|
Nach oben |
|
|
|