gd: Add optional dependency on fontconfig

Closes #26848.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>