新博客地址: http://ssendeavour.github.io/
这个博客不再更新了。
不食人间烟火
文档地址:fontspec doc
fontspec
支持配置文件,文档里有详细的讲解,这里忽略。
\fontspec [<font features>] {<font name>} # one-time use
\setmainfont [<font features>] {<font name>}
\setsansfont [<font features>] {<font name>}
\setmonofont [<font features>] {<font name>}
\newfontfamily <cmd> [<font features>] {<font name>}
The font features
argument accepts comma separated <font feature>=<option>
lists;
这些命令也影响像\mathrm
这样的数学模式使用的字体。
\textbf
, \textit
命令)。根据字体文件名。在XeTeX中,TeX发行版自带的OpenType字体(如/usr/local/texlive/2013/texmf-dist/fonts/opentype/public
)只能通过文件名加载。LuaTeX没有这个问题。在默认搜索路径(包括当前目录)上的字体可以只指定文件名,不用指定完整目录。
通过文件名选择的字体必需显式的指定粗体和斜体。如:
\fontspec [ BoldFont = texgyrepagella-bold.otf , ItalicFont = texgyrepagella-italic.otf , BoldItalicFont = texgyrepagella-bolditalic.otf ] {texgyrepagella-regular.otf}
或者
\fontspec
[ Extension = .otf ,
BoldFont = texgyrepagella-bold ,
... ]
{texgyrepagella-regular}
或者
\fontspec
[ Extension = .otf ,
UprightFont = *-regular ,
BoldFont = *-bold ,
... ]
{texgyrepagella}
或者加载不在默认搜索路径的字体,指定path选项:
\fontspec
[ Path = /Users/will/Fonts/ ,
UprightFont = *-regular ,
BoldFont = *-bold ,
... ]
{texgyrepagella}
以下命令声明全文使用的字体,它们的参数与fontspec
命令相同。
\setmainfont [<font features>] {<font name>}
\setsansfont [<font features>] {<font name>}
\setmonofont [<font features>] {<font name>}
\newfontfamily \<font-switch> [<font features>] {<font name>}
\newfontface \<font-switch> [<font features>] {<font name>}
这允许我们使用字体A + 字体B的粗体 + 字体C的斜体这种组合。
BoldFont = <font name>
ItalicFont = <font name>
BoldItalicFont = <font name>
SlantedFont = <font name>
BoldSlantedFont = <font name>
SmallCapsFont = <font name>
示例:
\fontspec[BoldFont={Helvetica Neue}]
{Helvetica Neue UltraLight}
fontspec
宏包必需在其他数学字体宏包(如euler)之后载入。fontspec
不改变一般的数学,只影响upright和bold。要改变数学符号的字体,请使用mathspec
或者unicode-math
宏包
\setmathrm [<font features>] {<font name>}
\setmathsf [<font features>] {<font name>}
\setmathtt [<font features>] {<font name>}
\setboldmathrm [<font features>] {<font name>}
使用以上命令显式设置要在\mathrm
这样的命令中使用的字体。
例子:
\usepackage{mathpazo}
\usepackage{fontspec,xunicode}
\setmainfont{Optima}
\setmathrm{Optima}
\setboldmathrm[BoldFont={Optima ExtraBlack}]{Optima Bold}
可以使用配置文件创建全局的或者每个字体的font feature。
找到了这样一段话:
OpenType fonts (and other ‘smart’ font technologies such as AAT and Graphite) can change the appearance of text in many different ways. These changes are referred to as features. When the user applies a feature — for example, small capitals — to a run of text, the code inside the font makes appropriate adjustments and small capitals appear in place of lowercase letters. However, the use of such features does not affect the underlying text. In our small caps example, the lowercase letters are still stored in the document; only the appearance has been changed by the OpenType feature. This makes it possible to search and copy text without difficulty. If the user selected a different font that does not support small caps, the ‘plain’ lowercase letters would appear instead. Some OpenType features are required to support particular scripts, and these features
small caps, the ‘plain’ lowercase letters would appear instead. Some OpenType features are required to support particular scripts, and these features are often applied automatically. Other features can be applied to support a particular language.
A very large group of OpenType features is designed to support high quality typography in Latin, Greek, Cyrillic and other standard scripts.
详细的feature请参考 fontspec
说明文档的第10节。
feature按照逻辑功能分类。所有的分类如下(fontspec doc 第10节)
\defaultfontfeatures{<font features>}
\defaultfontfeatures[<font name>] {<font features>}
重复使用这两个命令新设置会覆盖旧的。 例子:
\defaultfontfeatures[TeX Gyre Adventor]{Color=blue}
\setmainfont{TeX Gyre Adventor}% will be blue
\addfontfeatures{<font features>}
例子:
\addfontfeature{Numbers=OldStyle}...
\addfontfeature{Numbers=Lining}...
例子中,两次改变同一个feature,结果如何,要看具体字体。作者说以后会实现新的配置覆盖旧的配置。
BoldFeatures{<features>}
ItalicFeatures{<features>}
BoldItalicFeatures{<features>}
SlantedFeatures{<features>}
BoldSlantedFeatures{<features>}
SmallCapsFeatures{<features>}
例子:
\fontspec[
UprightFeatures={Color = 220022,
SmallCapsFeatures = {Color=115511}},
ItalicFeatures={Color = 2244FF,
SmallCapsFeatures = {Color=112299}},
BoldFeatures={Color = FF4422,
SmallCapsFeatures = {Color=992211}},
BoldItalicFeatures={Color = 888844,
SmallCapsFeatures = {Color=444422}},
]{TeX Gyre Termes}
Upright {\scshape Small Caps}\\
\itshape Italic {\scshape Italic Small Caps}\\
\upshape\bfseries Bold {\scshape Bold Small Caps}\\
\itshape Bold Italic {\scshape Bold Italic Small Caps}
xcolor
宏包,也可以使用它定义的颜色名称。再往下都是些用处不大的东西了。不写了。
other \usefont{OT1}{cmr}{m}{n}
Written with StackEdit.
Android开发权威指南(SDK2.3)笔记
4种方法:
intent.putExtra(key, value)
。在接收方:getIntent().getStringExtra(key)
, getIntent().getInt(key)
public static
的静态变量,在startActivity
之前为这些变量赋值。官方不推荐ClipboardManager clipboard =
(ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE);
, clipboard.setText(string);
。缺点:只能传递字符串。(注:可通过ByteArrayOutputStream
, ObjectOutputStream
, Base64
将可序列化的对象转换为字符串,接收方再转换为原对象来实现传递。getApplicationContext()
获得全局对象,并可对其属性赋值。几个重要的xml属性:
使用<include>
标签:
<include android:id="@+id/cell1" layout=@layout/workspace_screen" />
<include android:id="@+id/cell2" layout=@layout/workspace_screen" />
<include android:id="@+id/cell3" layout=@layout/workspace_screen" />
注:如果要覆盖布局的尺寸,必须同时覆盖android:layout_width
(原书为android:layout_weight)和android:layout_height
。只覆盖一个无效。
Written with StackEdit.
4种方法:
intent.putExtra(key, value)
。在接收方:getIntent().getStringExtra(key)
, getIntent().getInt(key)
public static
的静态变量,在startActivity
之前为这些变量赋值。官方不推荐ClipboardManager clipboard =
(ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE);
, clipboard.setText(string);
。缺点:只能传递字符串。(注:可通过ByteArrayOutputStream
, ObjectOutputStream
, Base64
将可序列化的对象转换为字符串,接收方再转换为原对象来实现传递。getApplicationContext()
获得全局对象,并可对其属性赋值。几个重要的xml属性:
使用<include>
标签:
<include android:id="@+id/cell1" layout=@layout/workspace_screen" />
<include android:id="@+id/cell2" layout=@layout/workspace_screen" />
<include android:id="@+id/cell3" layout=@layout/workspace_screen" />
注:如果要覆盖布局的尺寸,必须同时覆盖android:layout_width
(原书为android:layout_weight)和android:layout_height
。只覆盖一个无效。
Written with StackEdit.
华为的电信定制手机C8812连接Ubuntu后,打开调试模式,使用命令
adb devices
返回如下结果
➜ 51-android git:(develop) adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
emulator-5554 device
???????????? device
识别出了手机,也能在命令行的ADB中正常使用。但是却不能在Eclipse中使用,就因为那一行问号。解决办法不是Google官方的添加 /etc/udev/rules.d/51-android.rules 文件(添加这个文件之前adb devices显示的结果就是这样)。而是华为自己的问题,解决办法如下,来自这里
完成步骤5后就可以了,不要重启,我第一次找到这个方法时,按帖子说的重启了,结果又变回去了。
事实又一次证明,国产手机对于好玩机的人来说就是个坑,尤其是定制机。
Written with StackEdit.
无意中看到了CSDN办的黑马程序员训练营,培训Android开发,说是平均工资7K。学习时间4个月,学费13500,可就业后分12个月付款。下载了一集它的入学前必看的基础视频看了一下。想起了去年在东软的日子,都是同一性质批量生产程序员的培训机构,没多少区别。要说有区别,这个视频上讲课的教师思路清晰,写代码很快,是个老手。20多分钟就从零开始做了一个可以播放音频文件的Android出来,还注意到了基本的易错的地方。讲的节奏很快,照这个速度,如果是我学4个月应该能做一个合格的入门Android程序员了。
前几天也看了一个微软程序员的博客(刘未鹏,博客),他很重视学习方法,读了许多认知心理学方面的书。他也讲到现在的大学教育(软件开发这一块)与软件公司的用人需求严重脱节的现象,还专门写了一篇博文(怎样花两年时间去面试一个人)。分析这个问题并给出了可行的建议。他写到现在学软件的大学生的困惑:
绝大多数应届生直到毕业也不清楚他们想要去的公司到底需要什么样的能力,或者说,他们到底需要具备什么样的能力才能在应聘季节拥有自己的选择权。中国虽然本科教育环境差,但是同样有很多的人在本科希望整点东西出来,他们有一腔的激情和抱负,有强大的动力,但就是不知道自己需要掌握哪些技能才能满足雇主的要求,求告无门,整年整年苦闷的像没头苍蝇一样乱撞。
我觉得我就是这个处境,大学三年了,学了些C,C++的语言基础,也认真读完了《深入浅出MFC》对MFC的原理也大略有个了解。可也于了解,学完了基础就不知道接下来干什么了。我知道其实这主要是因此我懒,有那么多开源项目可以去学习,或者自己写小软件自娱自乐,可是我都没有做。我只乐于学习一些小Trick,比如结构体的内存对齐,C函数参数的入栈顺序有哪几种,C++的虚函数,纯虚函数,又或者一些漂亮的命令行命令,却又不去系统的学习bash。玩Linux又不去看鸟歌的书,也不编译内核,也不写大的程序。学了Python,仅止于能爬几个页面,处理个字符串,不去学Web框架。
我去学个黑马程序员培训班学的话,如果出来真能找到7k的工作,那比考研好多了。因为我就需要有实际的项目需求摆在那里,督促着我去学习,只有这样,我才知道该往哪里努力。而程序员学习本应该是这样的,以实际需求为导向,缺哪补哪。而且以我在大学学习的基础知识(操作系统,体系结构,算法),加上培训后掌握的开发经验,进一般的软件公司应该没有问题。进入公司,才算上了道。老在学校里,我又不会和人交往,永远不知道自己该干什么,知道了也没有压力和动力学习。对这个大学早已厌倦了。也不想继续读研究生了,虽然考上的可能性也很小。那就明年毕业后去黑马吧。
告诉我该做什么,怎样做,我就能做好。
Written with StackEdit.
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev\
libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev libperl-dev python-dev
其中libperl-dev和python-dev分别用于perl和python脚本支持。如果需要lua和ruby的支持,需要分别安装 liblua5.1-0-dev 和 ruby-dev。
git clone https://github.com/b4winckler/vim.git
cd ~/vim其中
./configure --with-features=huge --with-python-config-dir=/usr/lib/python2.7/config/ --enable-multibyte --enable-cscope --enable-fontset --enable-gui=auto --disable-hangulinput --enable-luainterp=yes --enable-perlinterp=yes --enable-pythoninterp=yes --enable-xim --prefix=/usr
![]() |
ZSH自动补全功能 |
make
./src/vim --version确认没有问题后,根据下面参考文档的建议,先把系统原来的vim卸载掉(我安装时没有卸载,安装后vi命令指向的还是原来的vim,vim也是原来的vim。因为我原来的vm安装在/usr/local/bin,现在的vim安装在/usr/bin,vi是vim的链接。新vim安装后好像不会更新vi的链接)
./src/vim
sudo apt-get remove vim vim-addon-manager vim-common vim-gui-common vim-tiny vim-scripts vim-runtime然后再安装
sudo make install
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 1
sudo update-alternatives --set editor /usr/bin/vim
sudo update-alternatives --install /usr/bin/vi vi /usr/bin/vim 1
sudo update-alternatives --set vi /usr/bin/vim