program f90_css_color implicit none integer,parameter::nmax=500,mmax=30 character(len=20)::loc(1:mmax) character(len=7)::E_col(1:mmax) character(len=7)::J_col(1:mmax) character(len=7)::str character(len=100)::linebuf(1:nmax),temp integer::i,j,n,m,num,io,k,iii character(len=50)::fnameR1,fnameR2 call getarg(1,fnameR1) !Input color arrangement call getarg(2,fnameR2) !Input model css i=0 open(11,file=fnameR1,status='old') read(11,'()') do i=i+1 read(11,*,iostat=io) loc(i),E_col(i),J_col(i) if(io<0)exit end do m=i-1 i=0 open(11,file=fnameR2,status='old') do i=i+1 read(11,'(a)',iostat=io) linebuf(i) if(io<0)exit end do n=i-1 do iii=1,2 if(iii==1)open(12, file='csmainE.css', status='replace') if(iii==2)open(12, file='csmainJ.css', status='replace') do i=1,n temp=linebuf(i) if(index(temp,'#font_name#')/=0)then if(iii==1)temp='font-family:tahoma;' if(iii==2)temp="font-family:'メイリオ',meiryo,sans-serif;" end if do j=1,m num=index(temp,trim(loc(j))) if(num/=0)then do k=num,num-1+len_trim(loc(j)) temp(k:k)=' ' end do if(iii==1)str=E_col(j) if(iii==2)str=J_col(j) do k=1,7 temp(num-1+k:num-1+k)=str(k:k) end do end if end do write(12,'(a)') trim(temp) end do close(12) end do end program f90_css_color