Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Portuguese

Pagetitle
GetFontList
GetFontList

Função: GetFontList

Retorna um array com o nome das fontes instaladas na estação que esta utilizando o Smart Client.

GetFontList ( ) --> aRet

aRet
    (vetor)
  • Retorna um array, no formato texto, como o nome das fontes disponíveis na estação de trabalho em uso.

Utilize esta função somente nos programas executados através do Smart Client.

Importante
Função disponível, na linguagem AdvPL, a partir da build 7.00.060322A
#include

 

 

Bloco de código
themeEclipse
languagecpp
titleExemplo
linenumberstrue
#INCLUDE "TOTVS.CH"
USER FUNCTION ShowFontInfos() Local i

 
// Lista as fontes disponíveis na máquina executando o Protheus Remote      
USER FUNCTION ShowFontInfos()
	Local i
	Local aFonts:= GetFontList()

	Local aSizes


	For i:=1 to Len(aFonts)

		QOut(aFonts[i])
Next

	Next
	
	if Len(aFonts)==0
return endif

		return
	endif
	
	// Obtém o tamanho dos characteres CHR(1) a CHR(254) da 1a Fonte

	// listada pela função GetFontList() no tamanho 8

	
	aSizes:= GetFontPixWidths(aFonts[1],8)

	
	// Exibe o tamanho em pixels da letra 'A' para a fonte aFonts[1]

	
	ShowCharWidth('A',aSizes,aFonts[1])

	
	// Exibe o tamanho em pixels da letra 'X'

	ShowCharWidth('X',aSizes,aFonts[1])

	
	// Exibe o tamanho em pixels da letra 'i'

	ShowCharWidth('i',aSizes,aFonts[1])

	
	// Exibe o tamanho em pixels da letra 'g'

	ShowCharWidth('g',aSizes,aFonts[1])
RETURN

RETURN

STATIC FUNCTION ShowCharWidth(c,aSizes,cFontName)

	Local cMsg

	Local nOrd:= ASC(c)

	cMsg:= 'Largura do "'+c+'" = '+AllTrim(Str(aSizes[nOrd]))+' pixels na Fonte '+cFontName+' tamanho 8'

	
	QOut( cMsg )
RETURN

 

             RETURN
Microsiga Protheus 8.11 , Protheus 10 , TOTVS Application Server 10 , ByYou Application Server