Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27640] Windows: unit specifier for fontSize should be ignored

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Do
Resolution Date2020-06-30T14:39:01.000+0000
Affected Version/sRelease 8.3.0
Fix Version/sn/a
ComponentsWindows
LabelsengSchedule
ReporterKota Iguchi
AssigneeChristopher Williams
Created2019-12-03T08:43:41.000+0000
Updated2020-06-30T14:39:01.000+0000

Description

Setting fontSize with unit specifier for Font shows smaller fonts. It also could end up throwing runtime exception when display information is not provided by Windows. We might want to just "ignore" unit specifier in order to keep parity between iOS.
var win = Ti.UI.createWindow({
    backgroundColor: 'green',
    layout: 'vertical',
    title: 'Label Demo'
});

var label1 = Ti.UI.createLabel({
    color: '#900',
    font: { fontSize: '48dp' },
    text: 'A simple label',
    top: 30,
    width: Ti.UI.SIZE, height: Ti.UI.SIZE
});

var label2 = Ti.UI.createLabel({
    color: '#900',
    font: { fontSize: 48 },
    text: 'A simple label',
    width: Ti.UI.SIZE, height: Ti.UI.SIZE
});

win.add(label1);
win.add(label2);
win.open();
Expected: Both Labels should be shown with same font size 48.

Comments

  1. Kota Iguchi 2019-12-04

    https://github.com/appcelerator/titanium_mobile_windows/pull/1440

JSON Source