fixing font index calculation -- may be related to #10