The onoad attribute should be on the body tag and not on the p element and you also forgot the brackets.
<body onload="fontSizer()">
<p id="font">Test</p>
Not really sure your code is of any actual use anyway as 10px is practically invisible for most use cases and your logixc is weird. Also instead of using onload just put the function call at the end of the html where most scripts should reside.
var element = document.getElementById('font');
var style = window.getComputedStyle(element , null).getPropertyValue('font-size');
var fontSize = parseFloat(style);
element .style.fontSize = (fontSize - 5) + 'px';
This should work better for getting the font size and cases where its not just an int but a float.