Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- AssetManager manager = m_dataCreator.getAssetManager(); //This is a provider for several resources
- View view = inflater.inflate(R.layout.chapter_layout, container, false);
- TextView dataView = (TextView)view.findViewById(R.id.chapter_data_view);
- //m_data is of type SpanableStringBuilder
- RelativeSizeSpan sa = new RelativeSizeSpan(4f);
- m_data.setSpan(sa, 1, 5, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); //Works well
- m_data.setSpan(new StyleSpan(Typeface.BOLD_ITALIC), 40, 50, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); //works well
- m_data.setSpan(Typeface.createFromAsset(manager, "fonts/TaameyAshkenaz-MediumOblique.ttf"),
- 10,
- 20,
- Spannable.SPAN_INCLUSIVE_INCLUSIVE); //Doesn't work
- //dataView.setTypeface(Typeface.createFromAsset(manager, "fonts/TaameyAshkenaz-MediumOblique.ttf"));
- //This would also work well if I will unmark it.
- dataView.setText(m_data, BufferType.SPANNABLE);
- return view;
- }
Advertisement
Add Comment
Please, Sign In to add comment