Search in sources :

Example 11 with Typeface

use of com.mta.tehreer.graphics.Typeface in project Tehreer-Android by mta452.

the class OpenTypeShapingActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_opentype_shaping);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    Spinner typefaceSpinner = findViewById(R.id.spinner_typeface);
    typefaceSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
            mTypeface = (Typeface) adapterView.getAdapter().getItem(i);
        }

        @Override
        public void onNothingSelected(AdapterView<?> adapterView) {
        }
    });
    typefaceSpinner.setAdapter(new TypefaceAdapter(this));
    typefaceSpinner.setSelection(0);
    mTypeSizeField = findViewById(R.id.field_type_size);
    mScriptTagField = findViewById(R.id.field_script_tag);
    mLanguageTagField = findViewById(R.id.field_language_tag);
    mTextField = findViewById(R.id.field_text);
}
Also used : Typeface(com.mta.tehreer.graphics.Typeface) Spinner(android.widget.Spinner) AdapterView(android.widget.AdapterView) View(android.view.View) AdapterView(android.widget.AdapterView) ActionBar(androidx.appcompat.app.ActionBar)

Example 12 with Typeface

use of com.mta.tehreer.graphics.Typeface in project Tehreer-Android by mta452.

the class TypefaceInfoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_typeface_info);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
    }
    Spinner typefaceSpinner = findViewById(R.id.spinner_typeface);
    typefaceSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
            loadTypeface((Typeface) adapterView.getAdapter().getItem(i));
        }

        @Override
        public void onNothingSelected(AdapterView<?> adapterView) {
        }
    });
    typefaceSpinner.setAdapter(new TypefaceAdapter(this));
    typefaceSpinner.setSelection(0);
}
Also used : Typeface(com.mta.tehreer.graphics.Typeface) Spinner(android.widget.Spinner) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) View(android.view.View) AdapterView(android.widget.AdapterView) ActionBar(androidx.appcompat.app.ActionBar)

Aggregations

Typeface (com.mta.tehreer.graphics.Typeface)12 ActionBar (androidx.appcompat.app.ActionBar)5 Paint (android.graphics.Paint)3 View (android.view.View)3 AdapterView (android.widget.AdapterView)3 Spinner (android.widget.Spinner)3 Intent (android.content.Intent)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 Typesetter (com.mta.tehreer.layout.Typesetter)2 TypeSizeSpan (com.mta.tehreer.layout.style.TypeSizeSpan)2 TypefaceSpan (com.mta.tehreer.layout.style.TypefaceSpan)2 ShapingResult (com.mta.tehreer.sfnt.ShapingResult)2 WritingDirection (com.mta.tehreer.sfnt.WritingDirection)2 ArrayList (java.util.ArrayList)2 Drawable (android.graphics.drawable.Drawable)1 SpannableString (android.text.SpannableString)1 ReplacementSpan (android.text.style.ReplacementSpan)1 DisplayMetrics (android.util.DisplayMetrics)1 ViewTreeObserver (android.view.ViewTreeObserver)1