/*

CLASS {AL4_font|_Java}, UNTESTED, NATIVE :

IMPORT, ANYWAY: {Font}, {AL4_drawing} .
//---------------------------------------------------------------- F O N T

NATIVE: "///copy NATIVE_font.java" .
NATIVE: "///copy AL4_font.java" .
*/

import java.util.ArrayList;
import java.io.*;
import java.lang.Math.*;
import android.widget.*;
import android.view.*;
import android.graphics.*;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.preference.ListPreference;
import android.preference.PreferenceManager;

import java.util.Timer;
import java.util.TimerTask;

public class AL4_font
{

	/*
	// Create FontEx object, return descriptor
	//---------------------------------------
	FUN Create_font({Font} F|ont_object, STR Face|_font,
		REAL Size|_font) ==> INT, NATIVE :
		"    RESULT = AL4_font.Do_Create_font(X_F, X_Face, X_Size);" .
	*/
	public static int Do_Create_font(Ref_obj X_F, String X_Face, double X_Size)
	{
		AL4_drawing.FontEx F = new AL4_drawing.FontEx();
        //F.Size = (int)X_Size;
		F.Face = Typeface.create(X_Face, Typeface.NORMAL);
		F.Facename = ""; //X_Face;
		//F.Size = AL4_form.Points_float(X_Size);
		F.Size = AL4_form.Points(X_Size);

		int X = AL4_form.Alloc_descriptor(F, X_F);
		F.Tag = X_F;
		return X;
	}

	/*
	// Destroy FontEx object
	//----------------------
	FUN Destroy_font(INT F|ont_handle), NATIVE :
		"     AL4_font.Do_Destroy_font(X_F);" .
	*/
	public static void Do_Destroy_font(int X_F)
	{
		//FontEx F = (FontEx)All_descriptors[X_F];
		//F.Dispose();
		AL4_form.ReleaseDescriptor(X_F);
	}

	///*
	// Change font face and size
	//--------------------------
    //FUN Change_font_face_size(INT F|ont_handle, STR Face|_font,
    //    REAL Size|_font) ==> REAL, NATIVE :
    //    "RESULT = AL4_drawing.Do_Change_font_face_size(X_F, X_Face, X_Size);" .
    //*/
    //public static double Do_Change_font_face_size(int X_F, String X_Face,
    //    double X_Size)
    //{
    //    FontEx F = (FontEx)AL4_form.All_descr.get(X_F).Jvc;
    //    F.Size = (int)X_Size;
    //    F.Font = new Font(X_Face, F.Style, AL4_form.Points(X_Size));
    //    return AL4_form.Pixels(F.Font.getSize());
    //}


	///*
	// Change font style
	//------------------
    //FUN Change_font_style(INT F|ont_handle,
    //    BOOL Styles|_font[{font_attr}])
    //    :
    //    -------------------------------------- 'Calculate value for font style'
    //    INT fs|tyles_mask = 0
    //    CASE Styles['BOLD'] ? fs++ ;
    //    CASE Styles['ITALIC'] ? fs += 2 ;
    //    CASE Styles['UNDERLINE'] ? fs += 4 ;
    //    CASE Styles['STRIKE'] ? fs += 8 ;
    //    -------------------------------------- 'Pass it to native Java function'
    //    Do_change_font_style(F, fs) .

    //FUN Do_change_font_style(INT F|ont_handle, INT Style|_value),
    //    NATIVE :
    //    "     AL4_drawing.Do_Change_font_style(X_F, X_Style);" .
    //*/
    //public static void Do_Change_font_style(int X_F, int X_fs)
    //{
    //    FontEx F = (FontEx)AL4_form.All_descr.get(X_F).Jvc;
    //    F.Style = 0;
    //    F.StyleEx = 0;
    //    if ((X_fs & 1) != 0) F.Style |= Font.BOLD;
    //    if ((X_fs & 2) != 0) F.Style |= Font.ITALIC;
    //    if ((X_fs & 4) != 0) F.StyleEx |= 4; // there is no UNDERLINE ?
    //    if ((X_fs & 8) != 0) F.StyleEx |= 8; // there is no STRIKEOUT ?
    //    F.Font = new Font(F.Font.getFamily(), F.Style,
    //        AL4_form.Points(F.Size));
    //}

	/*
	// Change font charset and pitch
	//------------------------------
	
	FUN Change_font_charset(INT F|ont_handle, INT Charset|_font),
		NATIVE :
		"     //AL4_drawing.Do_Change_font_charset(X_F, X_Charset);" .
	*/
	public static void Do_Change_font_charset(int X_F, int X_Charset)
	{
		//FontEx F = (FontEx)All_descriptors[X_F];
		//F.Font = new Font(F.Font.FontFamily, F.Font.Size, F.Font.Style, 
		//	GraphicsUnit.Point, (byte)X_Charset);
	}

}	
/*
END
*/
