Jump to content
Fivewin Brasil

impressao com as fontes de codigo de barras


MAMP2

Recommended Posts

nada estou usando a fonte do windows,

LOCAL cFontBC:=alltrim(memvar->te_drive)+"\LBPremium25FBa.TTF"

AddFontResource(cFontBC)

define font cFontBC name "LBPremium25FBa" size 65, -50 of ip_caixa

e imprimo normal.

ip_caixa:Say(lin_lis,sal_col*3,"*"+strzero(te_numero,10)+"*",cFontBC,0,CLR_BLALCK)

 

pra esta fonte que mandei funciona, para as fontes nativas do windows code128.TTF e code39r.TTF nao funciona

 

 

Link to comment
Share on other sites

*************************
function testa_etiqueta()
*************************


sal_lin = 11
sal_col = 4.5
linha   = sal_lin
coluna  = sal_col
te_numero = 0
te_nome = space(10)


define font memvar->rec_sen ;
  name "Courier"  ;
  size 10,15   ;
  bold


DEFINE DIALOG oDlg3 FROM 10,15  TO 17,70 ;
  TITLE "Controle de acesso : "+memvar->te_drive+" Terminal : "+memvar->te_term  ;
  font memvar->rec_sen

  @ linha,coluna say "NUMERO : " of oDlg3 pixel
  coluna += sal_col*09
  @ linha,coluna get oget var memvar->te_numero pict "9999999999" size sal_col*12,10 of oDlg3 pixel
  coluna += sal_col*12
  @ linha,coluna say "NOME   : " of oDlg3 pixel
  coluna += sal_col*08
  @ linha,coluna get oget1 var memvar->te_nome pict "@!" size sal_col*12,10 of oDlg3 pixel valid cont_etique()

activate dialog oDlg3 centered


Return (.t.)


**********************
function cont_etique()
**********************

memvar ip_caixa


LOCAL cFont39r:=alltrim(memvar->te_drive)+"\libreBarcode39-Regular.ttf"

AddFontResource(cFont39r)

memvar->oDlg3:End()

if memvar->te_esc_imp = "S"
  printerSetUp()
endif

print ip_caixa name " Teste etiqueta codigo de barras" preview
**\ print ip_caixa name " Teste etiqueta codigo de barras"

if Empty( ip_caixa:hDC )
  MsgStop( "Impressora com problemas" )
  close
  return nil
endif

te_prn_esc = upper(PrnGetName())

define font dl_cx_fo1 name "Calibri" size 12, -12 bold of ip_caixa
define font dl_cx_fo2 name "Arial" size 12, -14 bold of ip_caixa
define font dl_cx_fo3 name "Arial" size 14, -14 bold of ip_caixa
define font dl_cx_fo4 name "Arial Black" size 40, 25 bold of ip_caixa
define font dl_cx_fo5 name "Courier New" size 27, -12 bold of ip_caixa
define font dl_cx_fo6 name "Arial" size 10, -10 bold of ip_caixa
define font cFont39r name "LibreBarcode39-Regular" size 60, -70 of ip_caixa
define pen dl_caneta1 width 05 color CLR_BLACK

sal_lin  := ip_caixa:nVertRes() / 66
sal_col  := ip_caixa:nHorzRes() / 60

page

lin_lis := sal_lin*2

ip_caixa:Say(lin_lis,sal_col*3,"*"+strzero(te_numero,10)+"*",cFont39r,0,CLR_BLACK)

lin_lis += sal_lin*20

ip_caixa:Say(lin_lis,sal_col*3,te_nome,dl_cx_fo4,0,CLR_BLACK)

endpage

endprint

Return (.t.)

segue tambem a TTF que nao funciona pra voce ver

 

LibreBarcode39-Regular.ttf

Link to comment
Share on other sites

*************************
function testa_etiqueta()
*************************


sal_lin = 11
sal_col = 4.5
linha   = sal_lin
coluna  = sal_col
te_numero = 0
te_nome = space(10)


define font memvar->rec_sen ;
  name "Courier"  ;
  size 10,15   ;
  bold


DEFINE DIALOG oDlg3 FROM 10,15  TO 17,70 ;
  TITLE "Controle de acesso : "+memvar->te_drive+" Terminal : "+memvar->te_term  ;
  font memvar->rec_sen

  @ linha,coluna say "NUMERO : " of oDlg3 pixel
  coluna += sal_col*09
  @ linha,coluna get oget var memvar->te_numero pict "9999999999" size sal_col*12,10 of oDlg3 pixel
  coluna += sal_col*12
  @ linha,coluna say "NOME   : " of oDlg3 pixel
  coluna += sal_col*08
  @ linha,coluna get oget1 var memvar->te_nome pict "@!" size sal_col*12,10 of oDlg3 pixel valid cont_etique()

activate dialog oDlg3 centered


Return (.t.)


**********************
function cont_etique()
**********************

memvar ip_caixa


LOCAL cFont39r:=alltrim(memvar->te_drive)+"\Code39r.ttf"

AddFontResource(cFont39r)

memvar->oDlg3:End()

if memvar->te_esc_imp = "S"
  printerSetUp()
endif

print ip_caixa name " Teste etiqueta codigo de barras" preview
**\ print ip_caixa name " Teste etiqueta codigo de barras"

if Empty( ip_caixa:hDC )
  MsgStop( "Impressora com problemas" )
  close
  return nil
endif

te_prn_esc = upper(PrnGetName())

define font dl_cx_fo1 name "Calibri" size 12, -12 bold of ip_caixa
define font dl_cx_fo2 name "Arial" size 12, -14 bold of ip_caixa
define font dl_cx_fo3 name "Arial" size 14, -14 bold of ip_caixa
define font dl_cx_fo4 name "Arial Black" size 40, 25 bold of ip_caixa
define font dl_cx_fo5 name "Courier New" size 27, -12 bold of ip_caixa
define font dl_cx_fo6 name "Arial" size 10, -10 bold of ip_caixa
define font cFont39r name "Code39r" size 60, -70 of ip_caixa
define pen dl_caneta1 width 05 color CLR_BLACK

sal_lin  := ip_caixa:nVertRes() / 66
sal_col  := ip_caixa:nHorzRes() / 60

page

lin_lis := sal_lin*2

ip_caixa:Say(lin_lis,sal_col*3,"*"+strzero(te_numero,10)+"*",cFont39r,0,CLR_BLACK)

lin_lis += sal_lin*20

ip_caixa:Say(lin_lis,sal_col*3,te_nome,dl_cx_fo4,0,CLR_BLACK)

endpage

endprint

Return (.t.)

troquei para outra cod39r.ttf, tambem nao funciona, segue ela pra voce ver

Code39r.ttf

Link to comment
Share on other sites

O mesmo código visto por outro PRISMA: 

define font cFont39r name "Libre Barcode 39" size 60, -70 of ip_caixa //-> Theotokos(Rone)

#include "FiveWin.ch"
	#Define PAD_LEFT            0
#Define PAD_RIGHT           1
#Define PAD_CENTER          2
	FUNCTION testa_etiqueta()
	   sal_lin = 11
   sal_col = 4.5
   linha   = sal_lin
   coluna  = sal_col
   te_numero = 0
   te_nome = SPACE( 10 )
	   DEFINE FONT MEMVAR->rec_sen NAME "Courier New" SIZE 10, 15 BOLD
	   DEFINE DIALOG oDlg3 FROM 10, 15  TO 17, 70                                ;
      TITLE "Controle de acesso : " + MEMVAR->te_drive + " Terminal : " +    ;
      MEMVAR->te_term FONT MEMVAR->rec_sen
	   oDlg3:lHelpIcon := .F.
	   @ linha, coluna SAY "NUMERO : " OF oDlg3 PIXEL UPDATE
	   coluna += sal_col * 09
   @ linha, coluna GET oget VAR MEMVAR->te_numero PICT "9999999999"          ;
      UPDATE SIZE sal_col * 12, 10 OF oDlg3 PIXEL
	   coluna += sal_col * 12
   @ linha, coluna SAY "NOME   : " OF oDlg3 PIXEL UPDATE
	   coluna += sal_col * 08
   @ linha, coluna GET oget1 VAR MEMVAR->te_nome PICT "@!"                   ;
      SIZE sal_col * 12, 10 OF oDlg3 PIXEL VALID cont_etique() UPDATE
	   ACTIVATE DIALOG oDlg3 CENTERED
	   // FECHE AS FONTES AQUI
	RETURN ( .T. )
	FUNCTION cont_etique()
	   LOCAL ip_caixa //=> oPrn
	   // Desnecessario se ja estiver instalada na bandeja de FONTES.
   LOCAL cFONT39r := AllTrim( MEMVAR->te_drive ) + "\Code39r.ttf"
	   // se e MEMVAR, e depois da LOCAL
   // MEMVAR ip_caixa
	   // AddFONTResource( cFONT39r ) // desncessario se ja esta instalada.
	   MEMVAR->oDlg3:End()
	   IF MEMVAR->te_esc_imp = "S"
      PRINTERSETUP()
   ENDIF
	   // MUDEI EM: 04/04/2023 - Joao
   PRINT ip_caixa NAME "Teste etiqueta codigo de barras" PREVIEW MODAL
	   IF Empty( ip_caixa:hDC )
	      MsgStop( "Impressora com problemas" )
	      ip_caixa:End()
	      CLOSE
	      RETURN NIL
	   ENDIF
	   // ponha antes da impressao
   // te_prn_esc = Upper( PrnGetNAME() ) //???? reveja isso, sei la... kkkk
	   // Organizacao e Metodo.    // MUDEI EM: 04/04/2023 - Joao
   DEFINE FONT dl_cx_fo1 NAME "Calibri"     SIZE 12, -12 BOLD OF ip_caixa
   DEFINE FONT dl_cx_fo2 NAME "Arial"       SIZE 12, -14 BOLD OF ip_caixa
   DEFINE FONT dl_cx_fo3 NAME "Arial"       SIZE 14, -14 BOLD OF ip_caixa
   DEFINE FONT dl_cx_fo4 NAME "Arial Black" SIZE 40,  25 BOLD OF ip_caixa
   DEFINE FONT dl_cx_fo5 NAME "Courier New" SIZE 27, -12 BOLD OF ip_caixa
   DEFINE FONT dl_cx_fo6 NAME "Arial"       SIZE 10, -10 BOLD OF ip_caixa
   DEFINE FONT cFONT39r  NAME "Code39r"     SIZE 60, -70      OF ip_caixa
   // Caneta do Preview    // MUDEI EM: 04/04/2023 - Joao
   DEFINE PEN dl_caneta1 WIDTH 05 COLOR CLR_BLACK             OF ip_caixa
	   // MUDEI EM: 04/04/2023 - Joao
   oPrn:SetPage( 9 )   //-> A4 //9
   oPrn:SetPortrait()  //-> Vertical(Retrato)
	   sal_lin  := ip_caixa:nVertRes() / 66
   sal_col  := ip_caixa:nHorzRes() / 60
	   PAGE
	      lin_lis := sal_lin * 2
	      /* // Modelo:
      oPrn:Say( nLinha * ResLinha,  nColuna * ResColuna,                  ;
         "Orçamento Nº.: " + ALLTRIM( nProposta ), oFont, ,               ;
         CLR_BLACK, , PAD_CENTER )
      */
	      // MUDEI EM: 04/04/2023 - Joao o que e esse "*"
      ip_caixa:Say( lin_lis, sal_col * 3, "*" + StrZero( te_numero, 10 )     ;
         + "*", cFONT39r, , CLR_BLACK, , PAD_CENTER )
	      lin_lis += sal_lin * 20
	      ip_caixa:Say( lin_lis, sal_col * 3, te_nome, dl_cx_fo4, , CLR_BLACK, , PAD_CENTER )
	   ENDPAGE
	   ENDPRINT
	// MUDEI EM: 04/04/2023 - Joao
RETURN NIL // ( .T. ) // VERDADEIRO PORQUE? TEM VALID()? OXXYYYYYY kkkkk
	// fin / end

Regards, saludos.

Link to comment
Share on other sites

bom dia theotokos, nao deu certo.

*************************
function testa_etiqueta()
*************************


sal_lin = 11
sal_col = 4.5
linha   = sal_lin
coluna  = sal_col
te_numero = 0
te_nome = space(10)


define font memvar->rec_sen ;
  name "Courier"  ;
  size 10,15   ;
  bold


DEFINE DIALOG oDlg3 FROM 10,15  TO 17,70 ;
  TITLE "Controle de acesso : "+memvar->te_drive+" Terminal : "+memvar->te_term  ;
  font memvar->rec_sen

  @ linha,coluna say "NUMERO : " of oDlg3 pixel
  coluna += sal_col*09
  @ linha,coluna get oget var memvar->te_numero pict "9999999999" size sal_col*12,10 of oDlg3 pixel
  coluna += sal_col*12
  @ linha,coluna say "NOME   : " of oDlg3 pixel
  coluna += sal_col*08
  @ linha,coluna get oget1 var memvar->te_nome pict "@!" size sal_col*12,10 of oDlg3 pixel valid cont_etique()

activate dialog oDlg3 centered


Return (.t.)


**********************
function cont_etique()
**********************

memvar ip_caixa


LOCAL cFont39r:=alltrim(memvar->te_drive)+"\LibreBarcode39-Regular.ttf"

AddFontResource(cFont39r)

memvar->oDlg3:End()

if memvar->te_esc_imp = "S"
  printerSetUp()
endif

print ip_caixa name " Teste etiqueta codigo de barras" preview
**\ print ip_caixa name " Teste etiqueta codigo de barras"

if Empty( ip_caixa:hDC )
  MsgStop( "Impressora com problemas" )
  close
  return nil
endif

te_prn_esc = upper(PrnGetName())

define font dl_cx_fo1 name "Calibri" size 12, -12 bold of ip_caixa
define font dl_cx_fo2 name "Arial" size 12, -14 bold of ip_caixa
define font dl_cx_fo3 name "Arial" size 14, -14 bold of ip_caixa
define font dl_cx_fo4 name "Arial Black" size 40, 25 bold of ip_caixa
define font dl_cx_fo5 name "Courier New" size 27, -12 bold of ip_caixa
define font dl_cx_fo6 name "Arial" size 10, -10 bold of ip_caixa
define font cFont39r name "LibreBarcode39" size 60, -70 of ip_caixa
define pen dl_caneta1 width 05 color CLR_BLACK

sal_lin  := ip_caixa:nVertRes() / 66
sal_col  := ip_caixa:nHorzRes() / 60

page

lin_lis := sal_lin*2

ip_caixa:Say(lin_lis,sal_col*3,"*"+strzero(te_numero,10)+"*",cFont39r,0,CLR_BLACK)

lin_lis += sal_lin*20

ip_caixa:Say(lin_lis,sal_col*3,te_nome,dl_cx_fo4,0,CLR_BLACK)

endpage

endprint

Return (.t.)

segue como ficou pra sabe se fiz certo, mas nao funcionou

Link to comment
Share on other sites

*************************
function testa_etiqueta()
*************************


sal_lin = 11
sal_col = 4.5
linha   = sal_lin
coluna  = sal_col
te_numero = 0
te_nome = space(10)


define font memvar->rec_sen ;
  name "Courier"  ;
  size 10,15   ;
  bold


DEFINE DIALOG oDlg3 FROM 10,15  TO 17,70 ;
  TITLE "Controle de acesso : "+memvar->te_drive+" Terminal : "+memvar->te_term  ;
  font memvar->rec_sen

  @ linha,coluna say "NUMERO : " of oDlg3 pixel
  coluna += sal_col*09
  @ linha,coluna get oget var memvar->te_numero pict "9999999999" size sal_col*12,10 of oDlg3 pixel
  coluna += sal_col*12
  @ linha,coluna say "NOME   : " of oDlg3 pixel
  coluna += sal_col*08
  @ linha,coluna get oget1 var memvar->te_nome pict "@!" size sal_col*12,10 of oDlg3 pixel valid cont_etique()

activate dialog oDlg3 centered


Return (.t.)


**********************
function cont_etique()
**********************

memvar ip_caixa


LOCAL cFont39r:=alltrim(memvar->te_drive)+"\LibreBarcode39-Regular.ttf"

AddFontResource(cFont39r)

memvar->oDlg3:End()

if memvar->te_esc_imp = "S"
  printerSetUp()
endif

print ip_caixa name " Teste etiqueta codigo de barras" preview
**\ print ip_caixa name " Teste etiqueta codigo de barras"

if Empty( ip_caixa:hDC )
  MsgStop( "Impressora com problemas" )
  close
  return nil
endif

te_prn_esc = upper(PrnGetName())

define font dl_cx_fo1 name "Calibri" size 12, -12 bold of ip_caixa
define font dl_cx_fo2 name "Arial" size 12, -14 bold of ip_caixa
define font dl_cx_fo3 name "Arial" size 14, -14 bold of ip_caixa
define font dl_cx_fo4 name "Arial Black" size 40, 25 bold of ip_caixa
define font dl_cx_fo5 name "Courier New" size 27, -12 bold of ip_caixa
define font dl_cx_fo6 name "Arial" size 10, -10 bold of ip_caixa
//// define font cFont39r name "LibreBarcode39" size 60, -70 of ip_caixa

define font cFont39r name "Libre Barcode 39" size 60, -70 of ip_caixa


define pen dl_caneta1 width 05 color CLR_BLACK

sal_lin  := ip_caixa:nVertRes() / 66
sal_col  := ip_caixa:nHorzRes() / 60

page

lin_lis := sal_lin*2

ip_caixa:Say(lin_lis,sal_col*3,"*"+strzero(te_numero,10)+"*",cFont39r,0,CLR_BLACK)

lin_lis += sal_lin*20

ip_caixa:Say(lin_lis,sal_col*3,te_nome,dl_cx_fo4,0,CLR_BLACK)

endpage

endprint

Return (.t.)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...