CEGUI Font module Hack

May 4, 2010

不知道这种修改算不算得上Hack,为了能让CEGUI在亚洲系字体上能有更好的表现,需要将他的字体模块的缓冲机制(主要是Freetype字体类型)做一个比较大的修改,主要修改的内容如下:

初始化时间过长

CEGUI在初始化的时候,会便利一个字体中所有的Glyph,并在d_cp_map容器中初始化所有的FontGlyph对象。这个在英文字体下没有什么问题,因为一个字体中大约只有几百Glyph,但是在中文字体中这个值一般是65535个,所以初始化的时间过长。准备废除这个初始化的过程。

CEGUI使用一个bitmap,d_glyphPageLoaded作为一个codepoint有没有载入的标志,在这里废弃这个变量,直接使用d_cp_map容器中有没有对应的FontGlyph对象作为这个codepoint有没有载入的标志。

字体缓冲的贴图占用过多

CEGUI中的字体缓冲有一个算法,就是把字体中的Glyph分页,每个页是256个文字,一旦要渲染一个文字的时候,就把这个文字前后一共256个Glyph都渲染到一张贴图上。对于英文字体来说这样不是问题,一个字体最多渲染5到6张贴图就完事了,而且采用这种策略渲染好的贴图就不需要修改了。但是对于中文字体来说这不是一个好的策略,中文字体中文字个数繁多,而且不是采用使用频率在字体中排列的,你渲染的一个文字的前后255个文字说不定在整个过程中就不会使用得到,如果讨论在极端情况下,一个中文字体一共需要65535/256=256张贴图才可以完整的渲染完,这样我们可怜的显存里面就全部都是文字了,明显不可以接受。

计划使用一个简单的缓冲机制,就是一开始设定好一个字体可以使用多少张缓冲贴图,和每张贴图的尺寸(这里暂定512*512)。这样的策略实现起来比较简单,相对来说修改的代码量也不是很大,缺点是:

  1. CEGUI的贴图接口中并没有锁定或修改已存在的贴图内容,需要自己实现。
  2. 原始的贴图生成之后不需要修改了,现在需要经常修改,会有一定的效率损失。

First blog from iPad

April 30, 2010

I’m still trying to get input method working, so this is the Twitter like post. :D

Google Checkout 解封纪实

April 28, 2010

记得Nexus one刚刚出现的时候,就很激动的去使用google checkout下订单,下单之前了解清楚需要使用香港的收货地址,也找了常住香港的朋友,结果却悲剧的被google锁了账号,估计是我的信用卡的问题。于是将想到了去申述。这篇主要介绍一下如何进行申述的,帮助也有同样经历的人解决checkout被ban的问题。

其实把我的账户ban掉的原因很简单,就是我的信用卡的资料不对。不知道什么原因,google checkout内部支持的信用卡的国家地区选项里面吧中国剔除了(之前是有的,我肯定)于是我们就只能选用不正确的国家地区:香港。

我是2010-1-19日下的订单,三天之后checkout账户就被ban了,登陆checkout账户之后就提示我进行申述,于是我就准备了他要求的两种资料:

  1. 你个人的信息,可以是身份证或者是护照的扫描件,我选择的是护照的扫描件
  2. 可以证明你信用卡归属和billing address的信息,我们的billing address本来就是不正确的,所以我扫描了我的招行信用卡的账单和我的信用卡的正面(卡号的前9位遮住)
  3. 其他信息

这个其他信息非常重要,我写了一篇很热情洋溢的信,由于我的英文写作很差,所以破费周折,原文如下:

  I’m this credit card’s holder and I have left the correct card information. But the billing address I left was not match my bank billing address. Because there is no option "China" in the combobox when I was filling the billing adress form so I left the address where I was living one year ago when I’m working in HK. But then I moved to mainland China Shanghai.

  Under this special situation I am not able to provide the billing address of HK since I am now living in Shanghai and the bank send the bills to my new address in Shanghai. I sincerely hope you can understand my special situation and reactivate this account,so that I can place order again and ship Nuxus one to my uncle with his HK address.

  Thanks for your time and pls let me know if you want more documents to verify this account.

建议大家不要原文照抄,一定要修改修改。。。。。而且更加重要的事情,人家三天后就回信了,表明,就是要ban你,回信原文如下:

Hello Luyi,
Upon review of your account, it appears that your information corresponds
with a currently unsupported billing country. To view a list of supported
billing countries, check the Location: drop-down menu on the sign-up page.
As a result, your account associated with xxxx@gmail.com has been
suspended and the order(s) have been cancelled.
Any pending and future transactions made with this account will not be
processed.
We understand that order cancellations under these circumstances can be
disappointing. Please know that we look forward to offering more options
in the near future. We regret any inconvenience that this may cause and
appreciate your understanding.

于是我就组织了一份措辞稍稍严厉的信(不容易啊,就我这个英文水平),回复给了这个客服,原文如下:

Hi Mary

I totally understand why my account is suspended. As required, I have proved the credit card ownership, I think there is no reason to suspend my account any longer. You can drop my order, but cannot freeze it forever.
I just got a HSBC credit card which is issued in Hongkong two weeks ago, I think this one could be use in my checkout account. I love my Google account as xxxxxx@gmail.com. Please give me a chance to reactive it with checkout service. I don’t want to register another new account just for the stupid checkout issue.

 

结果放了两个礼拜都没有人理我,所以我估计这个email账号是一个noreply的账户,可惜给我的mail里面没有说明,于是就又去checkout的申述页面,提交了和上次一样的证明信息,并把和这位客服的来回mail放到了其他信息中。结果,第二天早上就收到了账户解封的mail。

我觉得没啥很难得地方,就是要和他们沟通,主要是表明,自己就是信用卡的主人,没有欺诈,祝大家好运 :D

Domain Change

January 19, 2010

因为一些众所周知的原因,我决定要放弃我的.cn的域名了,所以我的域名正式更改:

www.mypool.cn ======>>>>  www.hlouis.com

如果有人订阅过我的blog,请将订阅地址更新为:

http://www.hlouis.com/feed/

目前我的cn域名会持续到今年8月份到期,(当然,也可能在中途的任意时刻被停止解析)这段时间内这两个域名会同时指向我现在的网站,所以理论上会有很长的一段过渡时期。。。。。

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org