What are the potential benefits and drawbacks of using CSS for displaying text with custom fonts compared to converting text to an image in PHP?

When displaying text with custom fonts, using CSS allows for easier customization, scalability, and accessibility compared to converting text to an image in PHP. However, using CSS may result in slower loading times and potential compatibility issues with certain browsers.

<!DOCTYPE html>
<html>
<head>
    <style>
        @font-face {
            font-family: 'CustomFont';
            src: url('path/to/custom-font.ttf') format('truetype');
        }
        .custom-text {
            font-family: 'CustomFont', sans-serif;
            font-size: 16px;
            color: #333;
        }
    </style>
</head>
<body>
    <p class="custom-text">This is text displayed with a custom font using CSS.</p>
</body>
</html>