nikhilgaud / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

Feature: larger FieldLabel font sizes #222

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Support larger text on FieldLabels for individual blocks.

Original issue reported on code.google.com by bcjor...@gmail.com on 23 Apr 2014 at 6:03

Attachments:

GoogleCodeExporter commented 9 years ago
I did a bit of looking in to this, and may pick it up again soon.

My initial thoughts on an approach:

1. Allow for additional CSS classes to be passed in to FieldLabels during 
construction to set the text size. (Another option might be to create a new 
StyledFieldLabel class, or a setter which triggers a size recalculation)
2. Make the size_.height determined on render_(), same as size._width
3. Alter some of the usages of Blockly.BlockSvg.TITLE_HEIGHT in block_svg.js to 
account for the dynamically determined height

Attached is an example of the layout issue step #3 would need to address.

A different approach to #3 would be to change the text to use 
dominant-baseline: hanging, which would have the text anchored at the top-left 
rather than bottom-left, perhaps not requiring as much change to the svg 
rendering logic. But I'll be targeting IE9 as well which does not support this 
property.

Original comment by bcjor...@gmail.com on 23 Apr 2014 at 6:06

Attachments:

GoogleCodeExporter commented 9 years ago
Feel free to make me owner and mark this as an enhancement (I don't think I 
have permissions).

Original comment by bcjor...@gmail.com on 24 Apr 2014 at 5:24