{"record":{"id":"1796eab2d827aa6f","repo":"yiisoft/yii2","slug":"the-font-file-does-not-exist-this-fontfile","errorCode":null,"errorMessage":"The font file does not exist: {$this->fontFile}","messagePattern":"The font file does not exist: (.+?)","errorType":"exception","errorClass":"yii\\base\\InvalidConfigException","httpStatus":null,"severity":"error","filePath":"framework/captcha/CaptchaAction.php","lineNumber":121,"sourceCode":"     */\n    public $fixedVerifyCode;\n    /**\n     * @var string|null the rendering library to use. Currently supported only 'gd' and 'imagick'.\n     * If not set, library will be determined automatically.\n     * @since 2.0.7\n     */\n    public $imageLibrary;\n\n\n    /**\n     * Initializes the action.\n     * @throws InvalidConfigException if the font file does not exist.\n     */\n    public function init()\n    {\n        $this->fontFile = Yii::getAlias($this->fontFile);\n        if (!is_file($this->fontFile)) {\n            throw new InvalidConfigException(\"The font file does not exist: {$this->fontFile}\");\n        }\n    }\n\n    /**\n     * Runs the action.\n     */\n    public function run()\n    {\n        if (Yii::$app->request->getQueryParam(self::REFRESH_GET_VAR) !== null) {\n            // AJAX request for regenerating code\n            $code = $this->getVerifyCode(true);\n            Yii::$app->response->format = Response::FORMAT_JSON;\n            return [\n                'hash1' => $this->generateValidationHash($code),\n                'hash2' => $this->generateValidationHash(strtolower($code)),\n                // we add a random 'v' parameter so that FireFox can refresh the image\n                // when src attribute of image tag is changed\n                'url' => Url::to([$this->id, 'v' => uniqid('', true)]),","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/captcha/CaptchaAction.php#L103-L139","documentation":"Error \"The font file does not exist: {$this->fontFile}\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/captcha/CaptchaAction.php:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}