# Convert ImageSize to FieldSize [duplicate]

How might I construct a function called EmToPX[p] such that the following 2 InputFields would be the same width. If not please explain why doing such isn't possible.

InputField["a", ImageSize -> 100]
InputField["a", FieldSize -> EmToPX[100]]


After some trial an error ~7.2 appears to be the proper number of EMs above( InputField["a", FieldSize -> 7.2]), but after trying to convert to a function using proper ratios it appears such technique doesn't work very well.

EmToPX[p_] := (N[
p (1.888888 + CurrentValue[EvaluationNotebook[], "FontSize"]) ]);
Manipulate[
Column[{
InputField["a", ImageSize -> EmToPX[a]],
InputField["a", FieldSize -> a],
EmToPX[7.2]
}]
, {a, 1, 100}
]


Background: Ultimately I am working with Grid elements and would like an easy way to switch back and froth between CellSize,ImageSize,ItemSize,FieldSize.

• You might want to also read this – rm -rf Sep 16 '13 at 22:52
• I believe this is effectively a duplicate but I cannot find the original. Can anyone help? – Mr.Wizard Sep 17 '13 at 0:32
• If you're working with Grid, then for the love of all that is good and holy, don't do it this way. Use Pane to define your constraints, and let Grid just snap itself to the Pane elements. – John Fultz Sep 17 '13 at 5:17
• @JohnFultz You are quit right. That does solve my most immediate problem. I think it would be beneficial though if there there was a way to seamlessly add, and subtract between the EMs and pixels. At minimum a reason why such can't be done. – William Sep 17 '13 at 11:21
• @Mr.Wizard See above comment. – István Zachar Sep 18 '13 at 6:49