UITextView renders custom font incorrectly in iOS 7

I debugged this issue a little, and it seems to be a bug in the way NSLayoutManager layouts the text. As other answers pointed out, UITextView is build around TextKit since iOS7, and thus uses NSLayoutManager internally to layout text. UILabel uses Core Text to layout text directly. Both eventually use Core Text to render … Read more

right-to-left (RTL) in flutter

you have two choices : 1. force a locale ( and direction ) on all devices — method 1: with localization add flutter_localizations package to your pubspec.yml dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter then import ‘package:flutter/material.dart’; import ‘package:flutter_localizations/flutter_localizations.dart’; MaterialApp( localizationsDelegates: [ GlobalCupertinoLocalizations.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, ], supportedLocales: [ Locale(“fa”, “IR”), // OR Locale(‘ar’, ‘AE’) OR … Read more

How to set Navigation Drawer to be opened from right to left

In your main layout set your ListView gravity to right: android:layout_gravity=”right” Also in your code : mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close) { @Override public boolean onOptionsItemSelected(MenuItem item) { if (item != null && item.getItemId() == android.R.id.home) { if (mDrawerLayout.isDrawerOpen(Gravity.RIGHT)) { mDrawerLayout.closeDrawer(Gravity.RIGHT); } else { mDrawerLayout.openDrawer(Gravity.RIGHT); } } return false; } }; hope … Read more

RTL in Markdown

Actually as my friend Aevyz reminded me, Markdown parses HTML in it. You won’t need to change your parser. The quickest path to solve that I could think of is this: <div dir=”rtl”> سلام دنیا مرحبا العالم שלום בעולם ہیلو دنیا </div> So you need to add literally two lines to turn a whole document … Read more

Android context.getResources.updateConfiguration() deprecated

Inspired by Calligraphy, I ended up creating a context wrapper. In my case, I need to overwrite system language to provide my app users with the option of changing app language but this can be customized with any logic that you need to implement. import android.annotation.TargetApi; import android.content.Context; import android.content.ContextWrapper; import android.content.res.Configuration; import android.os.Build; import … Read more

Why does this code, written backwards, print “Hello World!”

There are invisible characters here that alter how the code is displayed. In Intellij these can be found by copy-pasting the code into an empty string (“”), which replaces them with Unicode escapes, removing their effects and revealing the order the compiler sees. Here is the output of that copy-paste: “class M\u202E{public static void main(String[]a\u202D){System.out.print(new … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)