android版网易新闻、今日头条的中文字体是怎么设置的
迷茫
迷茫 2017-04-17 13:39:13
0
3
1687

我发现网易新闻、今日头条的字体都偏细,偏扁,不同于默认的系统字体,反编译却没有发现字体文件,也没有发现自定义字体的地方,而且我更换系统字体后,他们也能自动采用新的系统字体。

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(3)
PHPzhong

In API 16, a fontFamily attribute is provided for modifying the font. The name can be obtained from %android-sdk%platformsandroid-16+datafontssystem_fonts.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="16dp"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingTop="16dp" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        android:typeface="normal" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="sans-serif-thin"
        android:text="@string/hello_world" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="sans-serif-condensed"
        android:text="@string/hello_world" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="sans-serif-condensed-light"
        android:text="@string/hello_world" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="sans-serif-monospace"
        android:text="@string/hello_world" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="courier new"
        android:text="@string/hello_world" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="sans-serif-smallcaps"
        android:text="@string/hello_world" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="cursive"
        android:text="@string/hello_world" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="casual"
        android:text="@string/hello_world" />

</LinearLayout>

The news page of NetEase News uses WebView

PHPzhong

Some of their fonts are customized with money and are not available in the font library

左手右手慢动作

This is NetEase News. You can see that his characters are relatively flat and thin.

Look at our application again. We don’t have fontFamily and typeface set. It’s quite rough

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template