<commit_before>﻿//MIT, 2014-2016, WinterDev 
using System;
namespace PixelFarm.Drawing
{
    public abstract class GraphicsPlatform
    {

        public abstract Canvas CreateCanvas(
            int left,
            int top,
            int width,
            int height,
            CanvasInitParameters canvasInitPars= new CanvasInitParameters());

       
        /// <summary>
        /// font management system for this graphics platform
        /// </summary>
        public abstract IFonts Fonts { get; }
        //public abstract Bitmap CreatePlatformBitmap(int w, int h, byte[] rawBuffer, bool isBottomUp);

    }
    public struct CanvasInitParameters
    {
        public object externalCanvas;
        public CanvasBackEnd canvasBackEnd;

        internal bool IsEmpty()
        {
            return externalCanvas == null && canvasBackEnd == CanvasBackEnd.Software;
        }
    }<commit_msg>1107: installed font provider, image buffer provider<commit_after>﻿//MIT, 2014-2016, WinterDev 
using System;
using System.Collections.Generic;

namespace PixelFarm.Drawing
{

    public abstract class GraphicsPlatform
    {

        public abstract Canvas CreateCanvas(
            int left,
            int top,
            int width,
            int height,
            CanvasInitParameters canvasInitPars = new CanvasInitParameters());


        /// <summary>
        /// font management system for this graphics platform
        /// </summary>
        public abstract IFonts Fonts { get; }


        //----------------------------------------------------------------------
        //set provider delegates before use it from comment graphics platform
        //----------------------------------------------------------------------

        //1.installed fonts provider
        static IEnumerable<string> s_installedFontProviderIter;
        public static void SetInstalledFontProvider(IEnumerable<string> installedFontProviderIter)
        {
            s_installedFontProviderIter = installedFontProviderIter;
        }
        //----------------------
        //2. image buffer provider from filename
        static ImageBufferProviderDelegate s_imgBufferProviderDel;
        public static void SetImageBufferProviderDelegate(ImageBufferProviderDelegate imgBufferProviderDel)
        {
            s_imgBufferProviderDel = imgBufferProviderDel;
        }

    }

    public delegate byte[] ImageBufferProviderDelegate(string filename);

    public struct CanvasInitParameters
    {
        public object externalCanvas;
        public CanvasBackEnd canvasBackEnd;

        internal bool IsEmpty()
        {
            return externalCanvas == null && canvasBackEnd == CanvasBackEnd.Software;
        }
    }
{'fraction_non_alphanumeric': 0.12041116005873716, 'fraction_numerical': 0.008076358296622614, 'mean_word_length': 1.8563941299790356, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1696903', 'n_tokens_mistral': 635, 'n_tokens_neox': 588, 'n_words': 179}