Visualizzazione dei risultati da 1 a 5 su 5

Discussione: [ac2] embedFonts

  1. #1
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929

    [ac2] embedFonts

    ciao a tutti,
    ho fatto una funzione dove carico dei dati e creo delle variabili in actionscript valorizzandole con i valori che carico, fin qui tutto bene, solo che vorrei utilizzare un pixel font ma non riesco ad includerlo...

    sul mio pc chiaramente si vede benissimo mentre dove il font non è installato non si vede nulla

    adesso embedFonts è impostato su false e almeno io lo vedo ma se imposto su true non si vede piu.

    nella libreria ho fatto anche nuovo carattere... non so piu come fare!! help

    codice:
    function carica(percorso,posizione) {
    	messaggi_load =["Caricamento avvenuto con successo!","Problema di connessione con il server!"];
    	var carico = new LoadVars();
    	carico.onLoad = function(success) {
    		if (success) {
    			testo_voce = "";
    			sposta = 0;
    			for (m=1; m<=this.totale; m++) {
    				clip = "clip"+m;
    				button = "tasto"+m;
    				posizione.createEmptyMovieClip(clip, m);
    				posizione.createTextField(button, m, sposta, 0, 70, 20);
    				// Formatto la variabile
    				scrittaformat = new TextFormat();
    				scrittaformat.color = "0x000000";
    				scrittaformat.align = "left";
    				scrittaformat.font = "Pixeldust"; //Pixeldust
    				scrittaformat.size = 10;
    
    				posizione[button].wordWrap = false;
    				posizione[button].multiline = false;
    				posizione[button].selectable = false;
    				posizione[button].embedFonts = false;
    				posizione[button].autoSize = true;
    				posizione[button].setNewTextFormat(scrittaformat);
    				posizione[button].text = posizione[button].toUpperCase();
    
    				if(m == this.totale){
    					testo_voce = this["voce"+m];
    					posizione[button].htmlText = testo_voce
    				}else{
    					testo_voce = this["voce"+m]+" | ";
    					posizione[button].htmlText = testo_voce
    				}
    				sposta += posizione[button]._width;
    			}
    			transition(posizione,750-posizione._width);
    		}else{
    		}
    	};
    	carico.load(percorso, this);
    }
    grazie mille!

  2. #2
    Utente di HTML.it L'avatar di and80
    Registrato dal
    Mar 2003
    Messaggi
    15,182
    Per fare l'embed di un font, oltre a inserirlo in libreria, lo devi concatenare.
    A questo punto lo puoi richiamare in un textfield usando un textformat per impostarlo e impostando embedFonts=true nel textfield.

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    grazie mille per la disponibilità

    ma nel linkage io ho spuntato la casella


    codice:
    function carica(percorso,posizione) {
    	messaggi_load =["Caricamento avvenuto con successo!","Problema di connessione con il server!"];
    	var carico = new LoadVars();
    	carico.onLoad = function(success) {
    		
    myFormat = new TextFormat()
    myFormat.font = "miofont"
    myFormat.size=10
    myFormat.color=0xFF0000 // rosso
    myFormat.bold = true
    myFormat.italic = true
    myFormat.autoSize = true
    		if (success) {
    			testo_voce = "";
    			sposta = 0;
    			for (m=1; m<=this.totale; m++) {
    				clip = "clip"+m;
    				button = "tasto"+m;
    				posizione.createEmptyMovieClip(clip, m);
    				posizione.createTextField(button, m, sposta, 0, 70, 20);
    
    				
    posizione[button].embedFonts = false
    posizione[button].autoSize = true
    posizione[button].multiline = false
    posizione[button].wordWrap = false
    posizione[button].html = true
    posizione[button].setTextFormat(myFormat)
    				//posizione[button].text = posizione[button].toUpperCase();
    
    				if(m == this.totale){
    					testo_voce = this["voce"+m];
    					posizione[button].htmlText = testo_voce
    				}else{
    					testo_voce = this["voce"+m]+" | ";
    					posizione[button].htmlText = testo_voce
    				}
    
    				sposta += posizione[button]._width;
    			}
    			transition(posizione,750-posizione._width);
    		}else{
    		}
    	};
    	carico.load(percorso, this);
    }
    io nel concatenamento ho messo miofont...

    scusa ma secondo te è tutto corretto?
    uffi

  4. #4
    Utente di HTML.it L'avatar di and80
    Registrato dal
    Mar 2003
    Messaggi
    15,182
    tutto corretto, ma oltre a setTextFormat aggiungi anche setNewTextFormat

  5. #5
    Utente di HTML.it
    Registrato dal
    May 2002
    Messaggi
    2,929
    PERFETTO!!!
    grazie mille 6 un grande sempre disponibile

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.