@@ -357,7 +357,7 @@ function renderColumnCellTree(gd, tableControlView, columnBlock, allColumnBlock)
357357
358358 var columnCell = renderColumnCell ( columnCells ) ;
359359
360- setFont ( columnCell ) ;
360+ supplyStylingValues ( columnCell ) ;
361361
362362 var cellRect = renderCellRect ( columnCell ) ;
363363
@@ -367,6 +367,7 @@ function renderColumnCellTree(gd, tableControlView, columnBlock, allColumnBlock)
367367
368368 var cellText = renderCellText ( cellTextHolder ) ;
369369
370+ setFont ( cellText ) ;
370371 populateCellText ( cellText , tableControlView , allColumnBlock , gd ) ;
371372
372373 // doing this at the end when text, and text stlying are set
@@ -440,7 +441,7 @@ function renderCellTextHolder(columnCell) {
440441 return cellTextHolder ;
441442}
442443
443- function setFont ( columnCell ) {
444+ function supplyStylingValues ( columnCell ) {
444445 columnCell
445446 . each ( function ( d , i ) {
446447 var spec = d . calcdata . cells . font ;
@@ -450,15 +451,20 @@ function setFont(columnCell) {
450451 color : gridPick ( spec . color , col , i ) ,
451452 family : gridPick ( spec . family , col , i )
452453 } ;
453- Drawing . font ( d3 . select ( this ) , font ) ;
454-
455454 d . rowNumber = d . key ;
456455 d . align = gridPick ( d . calcdata . cells . align , col , i ) ;
457456 d . cellBorderWidth = gridPick ( d . calcdata . cells . line . width , col , i ) ;
458457 d . font = font ;
459458 } ) ;
460459}
461460
461+ function setFont ( cellText ) {
462+ cellText
463+ . each ( function ( d ) {
464+ Drawing . font ( d3 . select ( this ) , d . font ) ;
465+ } ) ;
466+ }
467+
462468function sizeAndStyleRect ( cellRect ) {
463469 cellRect
464470 . attr ( 'width' , function ( d ) { return d . column . columnWidth ; } )
@@ -781,11 +787,6 @@ function updateYPositionMaker(columnBlock, element, tableControlView, gd, d) {
781787 return 'translate(' + xPosition ( d , d3 . select ( element . parentNode ) . select ( '.cellTextHolder' ) . node ( ) . getBoundingClientRect ( ) . width ) + ' ' + yPosition + ')' ;
782788 } ) ;
783789
784- // MathJax styling has to be killed for HTML DOM color specifications to seep through
785- cellTextHolder . selectAll ( 'svg' ) . selectAll ( '*' )
786- . attr ( 'fill' , null )
787- . attr ( 'stroke' , null ) ;
788-
789790 d . settledY = true ;
790791 } ;
791792}
0 commit comments