(TL;DR) Why would you want to add such code?
(???) To allow the user to optimize his experience on your site? The user can make any of these changes in his browser, if he wishes. Besides, in a well designed web page, the size of the font has been optimized by the coder to display at all screen widths. If you are trying to make up for a lack of knowledge of how to use breakpoints or scaling techniques, don't; your ambition defeats the essence of responsiveness which is to adapt/adjust to all screen sizes and densitites without user intervention. Continue reading, practicing, experimenting and learning. Typography on the web isn't a perfect world, yet; but it's very good and gradually getting better. Read... learn about the obstacles and achievements. Sounds like you would enjoy it.
Here are a couple of current articles worth reading:
Viewport Based Typography