Yes, it's true - using px in css for specifying font-size is not ideal. However, in my case, I have a unique situation.
I am currently developing a browser-based editor that is specifically designed for creating mobile content visually. The editor features a fixed-width 800*600px "canvas" that mimics what would be visible on a mobile device in landscape view. Surrounding the canvas are various toolbars, similar to those found in programs like Photoshop.
Inside the editor, there is a JSON format that is used to read and save mobile content. This JSON is later interpreted by a mobile app to display the appropriate content.
One aspect of the JSON format includes specifying font-size as an integer in dp units. My question now is: how can I convert this font-size to display correctly within my desktop web app, considering the canvas size is 800*600 px?
As a workaround, I managed to determine the PPI of my desktop browser, although I'm not entirely sure if this information will be useful.